Giter Club home page Giter Club logo

Comments (1)

tavinus avatar tavinus commented on August 16, 2024

That is interesting. The GS calls look pretty much identical. Weird.

EDIT: I though you had the pdfScale GS calls there, but now I am not sure.
Are those GS calls from pdfScale?
If not, can you run both calls with -v --print-gs-call for us to compare both calls and the verbose info?

I made some tests here and the GS calls seems identical, just with Width X Height changed.

Paper std 11x17

$ ./pdfScale.sh --print-gs-call -v -r 11x17 mint.pdf
pdfScale.sh v2.6.1 - Verbose Execution
   Single Task: Resize PDF Paper
       Dry-Run: FALSE
    Input File: mint.pdf
   Output File: mint.11X17.pdf
 Get Page Size: Adaptive Enabled
        Method: Grep
  Source Width: 596 postscript-points
 Source Height: 843 postscript-points
    Print Mode: Print ( auto/empty )
  Scale Factor: Disabled (resize only)
   Fit To Page: Enabled (default)
   Auto Rotate: PageByPage
   Flip Detect: No change needed
  Run Resizing: 11X17 ( 792 x 1224 ) pts
  Final Status: File created successfully
[GS RESIZE CALL STARTS]
"/usr/bin/gs" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dCompatibilityLevel="1.5" -dPDFSETTINGS="/printer" -dColorImageResolution=300 -dGrayImageResolution=300 -dColorImageDownsampleType="/Bicubic" -dGrayImageDownsampleType="/Bicubic" -dColorConversionStrategy=/LeaveColorUnchanged -dSubsetFonts=true -dEmbedAllFonts=true -dDEVICEWIDTHPOINTS=792 -dDEVICEHEIGHTPOINTS=1224 -dAutoRotatePages=/PageByPage -dFIXEDMEDIA -dPDFFitPage   -sOutputFile="mint.11X17.pdf" -c "" -f "mint.pdf"
[GS RESIZE CALL ENDS]

Paper custom in 15 10

$ ./pdfScale.sh --print-gs-call -v -r 'custom in 15 10' mint.pdf
pdfScale.sh v2.6.1 - Verbose Execution
   Single Task: Resize PDF Paper
       Dry-Run: FALSE
    Input File: mint.pdf
   Output File: mint.CUSTOM.pdf
 Get Page Size: Adaptive Enabled
        Method: Grep
  Source Width: 596 postscript-points
 Source Height: 843 postscript-points
    Print Mode: Print ( auto/empty )
  Scale Factor: Disabled (resize only)
   Fit To Page: Enabled (default)
   Auto Rotate: PageByPage
   Flip Detect: Wrong orientation detected!
                Inverting Width <-> Height
  Run Resizing: CUSTOM ( 720 x 1080 ) pts
  Final Status: File created successfully
[GS RESIZE CALL STARTS]
"/usr/bin/gs" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dCompatibilityLevel="1.5" -dPDFSETTINGS="/printer" -dColorImageResolution=300 -dGrayImageResolution=300 -dColorImageDownsampleType="/Bicubic" -dGrayImageDownsampleType="/Bicubic" -dColorConversionStrategy=/LeaveColorUnchanged -dSubsetFonts=true -dEmbedAllFonts=true -dDEVICEWIDTHPOINTS=720 -dDEVICEHEIGHTPOINTS=1080 -dAutoRotatePages=/PageByPage -dFIXEDMEDIA -dPDFFitPage   -sOutputFile="mint.CUSTOM.pdf" -c "" -f "mint.pdf"

Comparing

"/usr/bin/gs" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dCompatibilityLevel="1.5" -dPDFSETTINGS="/printer" -dColorImageResolution=300 -dGrayImageResolution=300 -dColorImageDownsampleType="/Bicubic" -dGrayImageDownsampleType="/Bicubic" -dColorConversionStrategy=/LeaveColorUnchanged -dSubsetFonts=true -dEmbedAllFonts=true -dDEVICEWIDTHPOINTS=792 -dDEVICEHEIGHTPOINTS=1224 -dAutoRotatePages=/PageByPage -dFIXEDMEDIA -dPDFFitPage   -sOutputFile="mint.11X17.pdf" -c "" -f "mint.pdf"
"/usr/bin/gs" -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dCompatibilityLevel="1.5" -dPDFSETTINGS="/printer" -dColorImageResolution=300 -dGrayImageResolution=300 -dColorImageDownsampleType="/Bicubic" -dGrayImageDownsampleType="/Bicubic" -dColorConversionStrategy=/LeaveColorUnchanged -dSubsetFonts=true -dEmbedAllFonts=true -dDEVICEWIDTHPOINTS=720 -dDEVICEHEIGHTPOINTS=1080 -dAutoRotatePages=/PageByPage -dFIXEDMEDIA -dPDFFitPage   -sOutputFile="mint.CUSTOM.pdf" -c "" -f "mint.pdf"

So, identical calls, just with different sizes in points.

While looking at the verbose info, I noticed that the custom call actually inverted the orientation and caused the script to invert the Width X Height. Not sure if that is relevant, but it is a difference.

   Auto Rotate: PageByPage
   Flip Detect: Wrong orientation detected!
                Inverting Width <-> Height

You can disable flip-detection with -f d. But this only inverts the values of Width and Height and nothing else.

You can also mess with the auto-rotation options to see if it helps.

from pdfscale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.