Hello,
I have PDF-tools bundle and a PDF with some extra space around the actual content.
May I use a PDF-tool to crop the PDF to visible are by a batch file, something like:
c:\Program Files\PDF-XChange\PDF Tools\PXCTools.exe /crop-to-visible c:\MyBig.pdf c:\MyBig-Cropped.pdf
Best regards,
Lukas
PDF crop to visible area (trim white space)
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Stefan - PDF-XChange
-
Vladimir G - Tracker Dev
- User
- Posts: 100
- Joined: Thu Nov 30, 2017 1:24 pm
Re: PDF crop to visible area (trim white space)
Hello LuP,
You can configure the standard Crop Pages tool and its Crop Pages action, then run it from the command line:
This command runs the Crop Pages tool on the specified PDF document, saves the result in the same folder with the “-Cropped” suffix added to the filename, opens the destination folder, and selects the resulting file.
For example, my configuration of the Crop Pages action is: i.e. the 'Show setup dialog while running' option is disabled, the 'Crop Method' option is set to 'Remove All White Space'.
To access the full set of Crop Pages options, click the gear icon or the All options... link:
You can find more information about running PDF-Tools from the command line here
Best regards,
You can configure the standard Crop Pages tool and its Crop Pages action, then run it from the command line:
Code: Select all
C:\Program Files\PDF-XChange\PDF Tools\PXCTools.exe /RunTool "pdft.tool.cropPages" "C:\MyBig.pdf" /Output:filename="%[Filename]-Cropped.pdf";folder=source;showfiles=openfolderFor example, my configuration of the Crop Pages action is: i.e. the 'Show setup dialog while running' option is disabled, the 'Crop Method' option is set to 'Remove All White Space'.
To access the full set of Crop Pages options, click the gear icon or the All options... link:
You can find more information about running PDF-Tools from the command line here
Best regards,
You do not have the required permissions to view the files attached to this post.
Vladimir
Software Developer
PDF-XChange Co. LTD
Software Developer
PDF-XChange Co. LTD
-
LuP
- User
- Posts: 8
- Joined: Tue Jul 12, 2016 1:38 pm
Re: PDF crop to visible area (trim white space)
Hello Vladimir,
thanks for the answer, I'll try it.
Best regards,
LuP
thanks for the answer, I'll try it.
Best regards,
LuP
-
Sean - PDF-XChange
- Site Admin
- Posts: 1124
- Joined: Wed Sep 14, 2016 5:42 pm
Re: PDF crop to visible area (trim white space)
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
LuP
- User
- Posts: 8
- Joined: Tue Jul 12, 2016 1:38 pm
Re: PDF crop to visible area (trim white space)
Hello,
I created a batch to crop PDF.
The problem is that the tool still prompts me for interaction: a "Crop Pages" dialog (like in PdfXChnge Editor) appears which forces me to pick the "Set to White Margins" button.
I need this choice to be selected with no user interaction, like a batch file.
Note also /RunTool:showui=no which I believed would force any user interaction.
The mail line within my batch is:
What am I doing wrong?
Best regards,
LuP
The problem is that the tool still prompts me for interaction: a "Crop Pages" dialog (like in PdfXChnge Editor) appears which forces me to pick the "Set to White Margins" button.
I need this choice to be selected with no user interaction, like a batch file.
Note also /RunTool:showui=no which I believed would force any user interaction.
The mail line within my batch is:
Code: Select all
"C:\Program Files\PDF-XChange\PDF Tools\PXCTools.exe" /RunTool:showui=no "pdft.tool.cropPages" "d:\Lukas\Jobs\Ulib-Hor.RDS\SO_238\100\VykZal#103-2.pdf" /Output:filename="%[Filename]-Cropped.pdf";folder=source;showfiles=openfolderBest regards,
LuP
You do not have the required permissions to view the files attached to this post.
-
Sean - PDF-XChange
- Site Admin
- Posts: 1124
- Joined: Wed Sep 14, 2016 5:42 pm
Re: PDF crop to visible area (trim white space)
HI LuP,
Please ensure the "Show setup dialog while running" option is disabled:
Kind regards,
Please ensure the "Show setup dialog while running" option is disabled:
Kind regards,
You do not have the required permissions to view the files attached to this post.
Sean Godley
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
Technical Writer
PDF-XChange Co LTD
Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623
-
LuP
- User
- Posts: 8
- Joined: Tue Jul 12, 2016 1:38 pm
Re: PDF crop to visible area (trim white space)
... Ok, this works. And a kind of similar: is the following:
okay to suppress the "Confirm File Replacemet" dialog (which I want) and to suppress opening the destination folder?
In my case, the "Confirm File Replacemet" dialog appears although I've specified /Output:overwrite:no – so?
Best regards.
LuP
Code: Select all
"C:\Program Files\PDF-XChange\PDF Tools\PXCTools.exe" /RunTool "pdft.tool.cropPages" "%~1" "/Output:filename="%~2";overwrite:yes;showfiles:noIn my case, the "Confirm File Replacemet" dialog appears although I've specified /Output:overwrite:no – so?
Best regards.
LuP
You do not have the required permissions to view the files attached to this post.
-
Vladimir G - Tracker Dev
- User
- Posts: 100
- Joined: Thu Nov 30, 2017 1:24 pm
Re: PDF crop to visible area (trim white space)
Hello LuP,
There is a typo in your command-line expression: you used '...overwrite:yes...' instead of '...overwrite=yes...'
Please try the correct syntax and let us know if you still experience any issues.
Best regards,
There is a typo in your command-line expression: you used '...overwrite:yes...' instead of '...overwrite=yes...'
Please try the correct syntax and let us know if you still experience any issues.
Best regards,
Vladimir
Software Developer
PDF-XChange Co. LTD
Software Developer
PDF-XChange Co. LTD