You are not logged in.

#1 2019-01-23 15:24:15

amir.varasteh
Member
Registered: 2010-04-25
Posts: 12

How to save a screenshot as PDF?

I'd like to take a desktop screenshot and save it as pdf (to be able to fully zoom in without losing quality). So, I don't want to convert an image to pdf.
Any ideas?

Last edited by amir.varasteh (2019-01-23 15:38:19)

Offline

#2 2019-01-23 15:41:29

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: How to save a screenshot as PDF?

The desktop is drawn as an image. There is no way to get better resolution than what is displayed on the screen.

If you have a webpage, then you can try to print to a file (Firefox has that option) or maybe there are extensions to save the page as pdf.

Last edited by progandy (2019-01-23 15:43:41)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2019-01-24 04:51:22

Lupo Alberto
Member
From: Gomel, Belarus
Registered: 2013-11-25
Posts: 84

Re: How to save a screenshot as PDF?

Look at it

Last edited by Lupo Alberto (2019-01-24 04:53:13)

Offline

#4 2019-01-24 09:30:07

Stratoblaster
Member
From: Earth
Registered: 2018-12-04
Posts: 60

Re: How to save a screenshot as PDF?

It is possible to do with a step or two in one instance however, it would require breaking the preset security mechanism within an application.
That being mentioned, I'm unsure how the forum mods would feel about presenting that information within the forum.

But it IS possible.

/SB


Supercalifragilisticexpialidocious

Offline

#5 2019-01-24 09:53:45

Lupo Alberto
Member
From: Gomel, Belarus
Registered: 2013-11-25
Posts: 84

Re: How to save a screenshot as PDF?

Stratoblaster wrote:

It is possible to do with a step or two in one instance however, it would require breaking the preset security mechanism within an application.

What you're talking about? Why you think it would break a security? Could you explain this assumption?

Offline

#6 2019-01-24 10:01:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: How to save a screenshot as PDF?

Edit: "@stratoblaster"

No, it's not.
This is not about saving a jpg wrapped into a pdf (and I'm not sure about security worries) - he wants "to be able to fully zoom in without losing quality" and that would (actual raster graphics aside) require X11 or wayland to operate on some sort of display PDF (like Quartz) which they do not. You can make single clients render themselves into vector graphics (Qt and cairo should be capable of this) and certainly print documents to PDF, but a screenshot™ is a dump of the rastered X11 display (and even if one would argue that one could render X11 into pdf, todays reality is that the vast majority of clients XPutImage the internal rendering of their representation onto the server rather than relying on the server to draw things - ie. the X11 server ends up rendering only raster graphics)

Last edited by seth (2019-01-24 10:02:21)

Online

#7 2019-01-24 11:06:42

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: How to save a screenshot as PDF?

Inkscape 0.91+ has a new "Trace Pixel Art" feature that might work a lot better for converting screenshots to vectors than regular tracing, see http://goinkscape.com/convert-pixel-art … -graphics/. So that could be worth a try. Probably easier than trying to hack X or Wayland to output vector information...

Edit: It works for a small bitmap such 100x100 but is really a bit too slow for a screenshot. Also, subpixel font rendering really messes up the output, so you would have to disable that first.

Last edited by Morn (2019-01-24 11:47:14)

Offline

#8 2019-01-24 14:33:44

Stratoblaster
Member
From: Earth
Registered: 2018-12-04
Posts: 60

Re: How to save a screenshot as PDF?

It is possible using convert (comes with Imagemagic). However, when using the default CLI syntax: convert some.png some.pdf  you do get prompted that due to a security policy, convert will not do it. Due to a possible (yet probably patched) flaw in Ghostscript.

I did mention that it was possible using a one or two step process (thus the above).
I have done this and using Zathura, the quality stays rather good when zooming in.
Of course, this was my experience...

/SB

Last edited by Stratoblaster (2019-01-24 14:40:45)


Supercalifragilisticexpialidocious

Offline

#9 2019-01-24 14:46:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,796

Re: How to save a screenshot as PDF?

https://stackoverflow.com/questions/529 … conversion

Also there are actually far, FAR, more ways to wrap an image into a pdf, but that's not what the OP seems to be after at all.
Actually he explicitly wrote:

I don't want to convert an image to pdf.

Online

#10 2019-01-24 14:49:03

Stratoblaster
Member
From: Earth
Registered: 2018-12-04
Posts: 60

Re: How to save a screenshot as PDF?

I stand corrected - I failed to read the last point in the original post.

/SB


Supercalifragilisticexpialidocious

Offline

#11 2019-01-24 14:49:42

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: How to save a screenshot as PDF?

The best quality you can get is a screenshot saved as PNG (e.g. with scrot) which can then be embedded lossless in a PDF with img2pdf) as mentioned by Lupo Alberto. It is still a raster image, though.

Edit: Too late.

Last edited by progandy (2019-01-24 14:50:34)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#12 2019-01-24 14:52:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: How to save a screenshot as PDF?

The quality cannot stay "rather good" unless the original resolution is "rather good".  You can't get increased resolution.  It is trivially easy to embed a raster image in a pdf and/or convert an image to a pdf, but the OP explicitly stated that this is not what they want to do.  So mentioning one clunky way that fails to do what the OP doesn't want and saying there may be a multistep process to acheive what the OP doesn't want to do really isn't useful.

But all of this seems to be an X-Y problem.  Amir, what are you really trying to do?  Why do you want a "pdf screenshot"?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2019-01-24 14:57:49

Stratoblaster
Member
From: Earth
Registered: 2018-12-04
Posts: 60

Re: How to save a screenshot as PDF?

Trilby wrote:

The quality cannot stay "rather good" unless the original resolution is "rather good".  You can't get increased resolution.  It is trivially easy to embed a raster image in a pdf and/or convert an image to a pdf, but the OP explicitly stated that this is not what they want to do.  So mentioning one clunky way that fails to do what the OP doesn't want and saying there may be a multistep process to acheive what the OP doesn't want to do really isn't useful.

As I mentioned (and will state again) I stand corrected. I failed to read the last point in the original post.

/SB

Last edited by Stratoblaster (2019-01-24 14:58:16)


Supercalifragilisticexpialidocious

Offline

Board footer

Powered by FluxBB