Forum for the PDF-XChange Editor - Free and Licensed Versions
Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Hi,
I would like to open a document to a specific region through the command line using the /A argument.
The idea is to open the file and fit the view to the red rectangle:
image.png
image(1).png
In the documentation, I can read:
viewrect=<left>,<top>,<width>,<height> – sets the view rectangle using float or integer values in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation. Use the page parameter before this command.
With these arguments, I expected the program to open the document and fit the view to the red box. The rectangle is located at 100,100 from the top left corner and is 200 pixels wide and 300 pixels high. Instead, I got this:
image(2).png
What am I missing?
test.pdf
You do not have the required permissions to view the files attached to this post.
The previous command line is exactly what I am trying on my example file.
I run it in the PowerShell terminal, in the PDF-XChange installation directory:
With these arguments on my test file, the view does not fit to the entire red box as I would like (screen #2 in the first post). Instead, I get the result shown in screen #3.
Just for reference regarding the coordinate system of the command-line parameters (like FitH, top):
The value in PDF-XChange Editor is calculated based on the following relationship (referencing RFC 8118 Section 3):
If the position is shifted, it's usually because the input value doesn't account for the current Windows display scale or the application's DPI resolution. The editor itself is rendering exactly where it is told to.
I've always had trouble understanding the concepts of resolution and zoom.
In my mind, an A4-sized PDF viewed at 100% zoom should have the same magnification as if I were printing it on A4 paper at 100%.
Glad to see you sorted it out.
And yes - when Windows scaling is involved, some setting up is required for the on screen 100% to match the 100% on paper.