Trusted PDF

60 views
Skip to first unread message

Sam Hentschel

unread,
May 15, 2017, 6:46:26 PM5/15/17
to qubes...@googlegroups.com
Hey All,

Another question, why is it that the qvm-convert-pdf function returns a
file that is slgihtly fuzzy?

I keep lots of copies of important documents that I want to convert to
secure pdfs since they don't need to have anything other than an image.
However, I need them to be as clear as possible so I can print them back
out as if they were the original.

Using qvm-convert-pdf currently makes a really fuzzy copy. How can I
fix this (if at all)?

--
Respectfully,
Sam Hentschel
FD6A 2998 5301 B440 D26B
7040 69D1 CE58 6FA5 BB5A
signature.asc

Bernhard

unread,
May 16, 2017, 2:33:51 AM5/16/17
to qubes...@googlegroups.com
> Hey All,
>
> Another question, why is it that the qvm-convert-pdf function returns a
> file that is slgihtly fuzzy?
>
> I keep lots of copies of important documents that I want to convert to
> secure pdfs since they don't need to have anything other than an image.
> However, I need them to be as clear as possible so I can print them back
> out as if they were the original.
>
> Using qvm-convert-pdf currently makes a really fuzzy copy. How can I
> fix this (if at all)?
>
Hi Sam, I have no answer to this. Instead I add another remark. After
conversion, I always do

pdfimages infile outbase

for file in outbase*; do convert $file $file.tif; done

for file in outbase*; do tesseract $file $filep.pdf -l lang pdf; done

pdftk cat outbase*.pdf cat output final.pdf


which makes again a full-text searchable PDF. It looses 60% of its
over-size at the same time.

Bernhard

Chris Laprise

unread,
May 16, 2017, 10:01:31 AM5/16/17
to Bernhard, qubes...@googlegroups.com
Thanks for that tip. I wonder if anyone has looked at scraping the
original text out of the pdf during conversion... returning it to the VM
with only safe text allowed and then combining with the sanitized pdf.
Qubes already has some text-sanitizing code, so the basic idea should be
sound.

--

Chris Laprise, tas...@openmailbox.org
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

Chris Laprise

unread,
May 16, 2017, 10:06:34 AM5/16/17
to Sam Hentschel, qubes...@googlegroups.com
On 05/15/2017 06:46 PM, Sam Hentschel wrote:
> Hey All,
>
> Another question, why is it that the qvm-convert-pdf function returns a
> file that is slgihtly fuzzy?
>
> I keep lots of copies of important documents that I want to convert to
> secure pdfs since they don't need to have anything other than an image.
> However, I need them to be as clear as possible so I can print them back
> out as if they were the original.
>
> Using qvm-convert-pdf currently makes a really fuzzy copy. How can I
> fix this (if at all)?
>


The line that does the rendering in qpdf-convert-server looks like this:

pdftocairo $INPUT_FILE -png -f $PAGE -l $PAGE -singlefile
$(basename $TEMP_PNG_FILE .png)

No resolution is specified and the pdftocairo man page says the default
res is 150 PPI. You could add the -r parameter for more resolution,
though you may also have to adjust MAX_IMG_WIDTH and HEIGHT in
qpdf-convert-client.

Chris Laprise

unread,
May 16, 2017, 10:21:44 AM5/16/17
to Sam Hentschel, qubes...@googlegroups.com
On 05/16/2017 10:06 AM, Chris Laprise wrote:
> On 05/15/2017 06:46 PM, Sam Hentschel wrote:
>> Hey All,
>>
>> Another question, why is it that the qvm-convert-pdf function returns a
>> file that is slgihtly fuzzy?
>>
>> I keep lots of copies of important documents that I want to convert to
>> secure pdfs since they don't need to have anything other than an image.
>> However, I need them to be as clear as possible so I can print them back
>> out as if they were the original.
>>
>> Using qvm-convert-pdf currently makes a really fuzzy copy. How can I
>> fix this (if at all)?
>>
>
>
> The line that does the rendering in qpdf-convert-server looks like this:
>
> pdftocairo $INPUT_FILE -png -f $PAGE -l $PAGE -singlefile $(basename
> $TEMP_PNG_FILE .png)
>
> No resolution is specified and the pdftocairo man page says the default
> res is 150 PPI. You could add the -r parameter for more resolution,
> though you may also have to adjust MAX_IMG_WIDTH and HEIGHT in
> qpdf-convert-client.
>

I created a Qubes issue for this:

https://github.com/QubesOS/qubes-issues/issues/2812

Vít Šesták

unread,
May 16, 2017, 12:13:03 PM5/16/17
to qubes-users
As a workaround, I believe I have somehow converted the PDF for a larger paper (e.g. A4 instead of A3). I don't remember it much, though.

Of course, the conversions should be done in some DVM.

Regards,
Vít Šesták 'v6ak'
Reply all
Reply to author
Forward
0 new messages