Skip to content

Releases: tavinus/pdfScale

v2.4.2 - Backgrounding3 *Cleanup

09 Aug 10:20
Compare
Choose a tag to compare
  • Code cleanup and formatting
  • Tabs to spaces
  • minor fix to has/noBackground functions (had no Gray detection)
    • these functions are not currently used

v2.4.1 - Backgrounding2 *RGB-fix

09 Aug 09:37
Compare
Choose a tag to compare
  • Fix RGB mode to 255-based numbers
  • Internally transform to percentage-based numbers to be used
  • Cannot use percentage-based RGB directly anymore
  • Updated help and readme with changes
  • Fix inverted info for black/white on gray mode
  • Still can't set HSB for RGB mode

v2.4.0 - Backgrounding

09 Aug 08:25
Compare
Choose a tag to compare
  • Enables the creation of backgrounds on the PDFs
    • Gray > --background-gray <percentage>
    • RGB > --background-rgb <"R G B">
    • CMYK > --background-cmyk <"C M Y K">
  • Will paint a colored box behind the document
  • Updated help and readme for background creation
  • Will bypass creation if no background is set
  • Added many helper functions do validate and process colors and numbers
  • Color specifications must be quoted as a single parameter

v2.3.9 - TypoMadness3

26 May 03:23
Compare
Choose a tag to compare

I don't want to keep using the word hate, so I changed the trend. 🥇

But yeah. Another stupid typo found on help.
At least this time it was not the word bottom.

Nobody seems to read the help info though, or maybe people just don't care about the typos.

Whatever... whenever I detect a friggin typo I will correct it anyways.
Please create an issue if you find one!

Cheers!
Gus

v2.3.8 - HateTypos 2

07 May 22:14
Compare
Choose a tag to compare
  • Fix typo on help ( bootom )

Seems like I am not capable of writing bottom properly.

v2.3.7 - HateTypos

27 Apr 22:10
Compare
Choose a tag to compare
  • Fix typo on help ( top-bottim )
  • Update readme.md examples

I really do hate typos...

v2.3.6 - Keep Patching

12 Apr 10:11
Compare
Choose a tag to compare

Upgrade Info

If you have 2.3.0 or later you can upgrade with the --upgrade parameter

pdfscale --upgrade

Additions since v2.3.0

  • Fix printPageResize() print (was printing scale call)
    • Actual resize was fine, just printing was swapped
  • Removed cat dependency yet again (killing the cat yet again)
    • It is not that I hate cat or anything like that, but I prefer built-ins
  • Added option --yes|--assume-yes
    • Makes install and upgrade not prompt the user for confirmation
    • sudo may still ask for password on install
  • Added option --insecure|--no-check-certificate
    • Makes curl/wget ignore SSL certificates (HTTPS)
  • Fix grep method exit on adaptive method for some rare cases
    • Rebuilt the grep method and added some extra fail-safe checks
    • Changed the bash parsing
  • Rebuilt --upgrade and --install options
    • Better checks and code cleanup
  • Upgrade routine will try to clean up after itself
    • Tries to remove downloaded file and extracted folder when closing
  • Readme.md now includes basic info about installing and upgrading

v2.3.0 - Install & Upgrade

01 Apr 23:40
Compare
Choose a tag to compare

This is the first version capable of self-installing and self-upgrading from CLI options.
Both routines may ask for confirmation.
There is currently no way to force yes on those confirmations (will be implemented later).

Installation

  • Use the option --install or --self-install
  • Defaults to /usr/local/bin/pdfscale
  • Custom location can be specified, eg. --install /home/user/bin/pdfscale
  • Will ask to retry with sudo if it fails the first time

Upgrading

  • Use option --upgrade or --self-upgrade
  • Downloads current master on /tmp and prints version comparison
  • Will ask for confirmation
  • Target install is the location of the running pdfScale
  • Will ask to retry with sudo when it first fails

So Version 2.3.0 is the lowest version people should have in order to self-upgrade.

v2.2.1 - Simulacron

01 Apr 13:48
Compare
Choose a tag to compare

v2.2.1 - Simulacron

New options to simulate / generate GS call

--dry-run

  • Will bypass the Ghostscript calls
  • GS will not be called
  • No file will be generated

--print-gs-call

  • Will print GS calls to stdout
  • Calls have a START / END tag
  • Calls are printed at the very end (after verbose info)
  • Verbose setting is unrelated / not needed

Example (just get scaling gs call)

$ pdfscale ../pdfScale-linuxmagazin.pdf -s 1.05 --dry-run --print-gs-call
[GS SCALE 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=612 -dDEVICEHEIGHTPOINTS=792 -sOutputFile="../pdfScale-linuxmagazin.SCALED.pdf" -c "<</BeginPage{1.05 1.05 scale -14.571108 -18.856728 translate}>> setpagedevice" -f "../pdfScale-linuxmagazin.pdf"
[GS SCALE CALL ENDS]

Example (mixed mode - 2 GS calls)

$ ./pdfScale.sh -v -v ../pdfScale-linuxmagazin.pdf -s 1.05 --hor-align left --vert-align top --xtrans -20 --ytrans 50 --dry-run --gs-call -r source
2018-04-01:10:43:28 | pdfScale.sh v2.2.1 - Verbose Execution
2018-04-01:10:43:28 |    Mixed Tasks: Resize & Scale
2018-04-01:10:43:28 |        Dry-Run: TRUE (Simulating)
2018-04-01:10:43:28 |     Input File: ../pdfScale-linuxmagazin.pdf
2018-04-01:10:43:28 |    Output File: ../pdfScale-linuxmagazin.SOURCE.SCALED.pdf
2018-04-01:10:43:28 |  Get Page Size: Adaptive Enabled
2018-04-01:10:43:28 |         Method: Grep
2018-04-01:10:43:28 |   Source Width: 612 postscript-points
2018-04-01:10:43:28 |  Source Height: 792 postscript-points
2018-04-01:10:43:28 |    Auto Rotate: PageByPage
2018-04-01:10:43:28 |    Flip Detect: No change needed
2018-04-01:10:43:29 |   Run Resizing: SOURCE ( 612 x 792 ) pts
2018-04-01:10:43:29 |      New Width: 612 postscript-points
2018-04-01:10:43:29 |     New Height: 792 postscript-points
2018-04-01:10:43:29 |   Scale Factor: 1.05
2018-04-01:10:43:29 |     Vert-Align: TOP
2018-04-01:10:43:29 |      Hor-Align: LEFT
2018-04-01:10:43:29 |  Translation X: -20.00 = 0.00 + -20.00 (offset)
2018-04-01:10:43:29 |  Translation Y: 12.29 = -37.71 + 50.00 (offset)
2018-04-01:10:43:29 |    Run Scaling: 5 %
2018-04-01:10:43:29 |   Final Status: Simulation completed 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=612 -dDEVICEHEIGHTPOINTS=792 -sOutputFile="../pdfScale-linuxmagazin.SOURCE.SCALED.225177550_TEMP_2509725132.pdf" -c "<</BeginPage{1.05 1.05 scale   translate}>> setpagedevice" -f "../pdfScale-linuxmagazin.pdf"
[GS RESIZE CALL ENDS]
[GS SCALE 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=612 -dDEVICEHEIGHTPOINTS=792 -sOutputFile="../pdfScale-linuxmagazin.SOURCE.SCALED.pdf" -c "<</BeginPage{1.05 1.05 scale -20 12.286544 translate}>> setpagedevice" -f "../pdfScale-linuxmagazin.SOURCE.SCALED.225177550_TEMP_2509725132.pdf"
[GS SCALE CALL ENDS]

v2.2.0 - TakeControl Version

01 Apr 09:10
Compare
Choose a tag to compare

v2.2.0 - TakeControl

This version gives extra control over the ghostscript call.
It also provides comprehensive ways to reposition the PDF image when scaling.

This version addresses some open issues on github

New Options Added

--image-resolution

  • Sets DPI of BW and Color images, defaults to 300
  • Added on 2.1.3 from @czr 's fork (pulled)

--horizontal-alignment|--hor-align|--xalign|--x-align

  • Sets Horizontal Alignment to Left, Right or Center
  • Defaults to center (as it has always been)

--vertical-alignment|--ver-align|--vert-align|--yalign|--y-align

  • Sets Vertical Alignment to Top, Bottom or Center
  • Defaults to center (as it has always been)

--xtrans|--xtrans-offset|--xoffset

  • Adds/Subtracts from the XTranslation factor
  • Makes possible to move PDF on X axis

--ytrans|--ytrans-offset|--yoffset

  • Adds/Subtracts from the YTranslation factor
  • Makes possible to move PDF on Y axis