What is this for in Set Margins?

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

titeuf
User
Posts: 59
Joined: Mon Sep 07, 2020 10:11 pm

What is this for in Set Margins?

Post by titeuf »

What is this for in Set Margins?
I couldn't understand its use.
Snipaste_2025-05-22_21-02-32.png
You do not have the required permissions to view the files attached to this post.
User avatar
rakunavi
User
Posts: 1673
Joined: Sat Sep 11, 2021 5:04 am

Re: What is this for in Set Margins?

Post by rakunavi »

Hello titeuf,

Please consider that the Set Margins feature is a tool that ensures the specified margins while preserving the aspect ratio of the outermost borders of the contents.

If you try to maintain the aspect ratio of the outermost borders of contents, the sum of the top and bottom margins and the sum of the left and right margins will naturally be constrained, since the page size is constant. However, as you can see in the settings dialog, the top, bottom, left, and right margins can all be set freely. More precisely, the sum of the top and bottom margins and the sum of the left and right margins are not constrained in any way.

The Set Margins feature adopts the more restrictive of the sum of the top and bottom margins and the sum of the left and right margins and increases the less restrictive margins in order to maintain the aspect ratio of the outermost borders of contents. As a result, there will be leeway in where content is placed with respect to the margin on the side with the looser condition. Because of the freedom of placement, the application asks the user in advance which way he/she would like to position it. That is the setting you are asking about.

The following is an explanation with specific figures.

For example, suppose that the paper size is W:200 x H:300 and the content is placed with an outer border size of W:150 x H:150. In this case, if the margins are set to Top:0, Bottom:0, Left:50, Right:50, the sum of the top and bottom margins will be 0, and the sum of the left and right margins will be 100.

These numbers represent the minimum margins that must be maintained, and in this case, the left and right margins of 100 take precedence over the top and bottom margins of 0. Thus, the content is scaled to W:100 x H:100 while maintaining the aspect ratio.

  • figure.png
  • sample.pdf
The left and right margins are each set as specified by the user. For the sum of the top and bottom margins, 200 would be set, which is determined by subtracting the content height of 100 from the page height of 300. However, the sum of the user-specified top and bottom margins is 0. Thus, the application cannot determine where to place content at the top and bottom unless instructed to do so. Therefore, user instructions for placement are necessary.

Please note that the above is just a guess of the internal algorithm based on my operating experience. I am sure PDF-XChange will correct me if I am wrong.

Best regards,
rakunavi
You do not have the required permissions to view the files attached to this post.
TOP desires for PDFXCE
forum.pdf-xchange.com/viewtopic.php?t=39665 LassoTool
forum.pdf-xchange.com/viewtopic.php?t=38554 CmtGarbled
forum.pdf-xchange.com/viewtopic.php?t=37353 FulScrMultiMon
forum.pdf-xchange.com/viewtopic.php?t=41002 DisableTouchSelect
User avatar
Dimitar - PDF-XChange
Site Admin
Posts: 2207
Joined: Mon Jan 15, 2018 9:01 am

Re: What is this for in Set Margins?

Post by Dimitar - PDF-XChange »

Thanks for the detailed description of the feature, rakunavi.

This is pretty much exactly how it works.

Regards.