Print scaling - force "Actual size"

540 views
Skip to first unread message

JOHO

unread,
Feb 19, 2014, 9:50:50 AM2/19/14
to wkhtmltop...@googlegroups.com
In Adobe Acrobat Pro it's possible to set "Page Scaling" to "None" in the advanced settings for the document. This forces the print settings to be set to "Actual Size" in Adobe softwares (not tested other software).
It looks like it's possible to set some metadata containing "/ViewerPreferences << /PrintScaling /None >> >>" to achieve this. See links below.
http://superuser.com/a/487587
http://stackoverflow.com/a/8062099

Does wkhtmltopdf support this? If not - can anyone of the developers look into it?

A command line argument would have been nice :)

Regards,
JOHO
acrobat_advanced_settings.png

Cory Nelson

unread,
Feb 19, 2014, 2:56:13 PM2/19/14
to wkhtmltop...@googlegroups.com
On Wednesday, February 19, 2014 8:50:50 AM UTC-6, JOHO wrote:
In Adobe Acrobat Pro it's possible to set "Page Scaling" to "None" in the advanced settings for the document. This forces the print settings to be set to "Actual Size" in Adobe softwares (not tested other software).
It looks like it's possible to set some metadata containing "/ViewerPreferences << /PrintScaling /None >> >>" to achieve this. See links below.
http://superuser.com/a/487587
http://stackoverflow.com/a/8062099

Does wkhtmltopdf support this? If not - can anyone of the developers look into it?

I'd like to see this as well. A workaround I've found to work is to set a body size in CSS and print with --zoom 1.5. It seems to auto scale correctly.

kulkarn...@gmail.com

unread,
Feb 20, 2014, 2:43:02 AM2/20/14
to wkhtmltop...@googlegroups.com
Please create an issue on Github, so that this can be tracked.

JOHO

unread,
Feb 20, 2014, 6:52:57 AM2/20/14
to wkhtmltop...@googlegroups.com
This perl module can be used to set this option:
http://search.cpan.org/~ssimms/PDF-API2-2.020_01/lib/PDF/API2.pm

Simple script:

use strict;
use warnings;
use PDF::API2;
my $pdf = PDF::API2->open($ARGV[0]);
$pdf->preferences(-printscalingnone => 1);
$pdf->saveas($ARGV[0]);

JOHO

unread,
Feb 25, 2014, 4:44:37 AM2/25/14
to wkhtmltop...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages