Skip to content

Scaling seems off for some PDFs containing images #51

@sanketr

Description

@sanketr

The scaling to A4 size for the attached pdf seems off (on Mac Darwin Kernel Version 23.6.0). Perhaps it has something to do with images in pdf.

Sample run:

$ ./pdfScale.sh -v -r A4 -a none out.pdf
pdfScale.sh v2.6.3 - Verbose Execution
Single Task: Resize PDF Paper
Dry-Run: FALSE
Input File: out.pdf
Output File: out.A4.pdf
Explode PDF: Disabled
Get Page Size: Adaptive Enabled
Method: Grep
Page Range: None (all pages)
Source Width: 330 postscript-points
Source Height: 566 postscript-points
Print Mode: Print ( auto/empty )
Scale Factor: Disabled (resize only)
Fit To Page: Enabled (default)
Auto Rotate: None
Flip Detect: No change needed
Run Resizing: A4 ( 595 x 842 ) pts
Final Status: File created successfully

'pdfinfooutput shows scaling is 490x841 instead.gs` will have the same behavior when device width and height are set. This is very puzzling.

$ pdfinfo ./out.A4.pdf

...

Pages: 2
Encrypted: no
Page size: 490.363 x 841.97 pts
Page rot: 0
File size: 873704 bytes
Optimized: no
PDF version: 1.5

It seems something specific to interaction between gs and the attached pdf. Preview on Mac will scale it fine to correct size when A4 size is set in print option.

out.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions