Scaledown PDF and recenter the content | Community
Skip to main content
October 11, 2022
Solved

Scaledown PDF and recenter the content

  • October 11, 2022
  • 2 replies
  • 1112 views

Hello All,

 

I have been trying to scaledown the PDF content and trying to recenter it but that isn't working. The following solution works only for specific PDF sheet size. If there is a different PDF sheet size, this solution is not working. Hoping to find a solution applicable to any PDF sheet sizes.

 

<PDF result="targetDoc">

  <PDF source="inDoc">

    <Transform  scale="0.75" newX="1in" newY="1in">

  </PDF>

</PDF>

...

<PDF result="outDoc">

  <PDF source="targetDoc"/>

</PDF>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mayank_Gandhi

Hi Mayank,

 

Yes, if I provide different newX and newY values, the PDF content appears center of the page but again this configuration effects the A4 page size PDF. I am trying to find a generic solution to recenter the PDF content without giving newX and newY which works only for one specific PDF page size.


@pavan_mekala no it to won't generically. You can create multiple routes in workbench for different page size or if else if doing operation via java code

2 replies

Mayank_Gandhi
Adobe Employee
Adobe Employee
October 11, 2022

@pavan_mekala you can also use optimize pdf for reducing the size. for assembler, this worked for me. Dont use "in" but value or pt in newX

 

<PDF result="doc3.pdf">

<PDF source="doc1.pdf">

<Transform scale="0.25" newX="50" newY="80" rotate90="90"/>

</PDF> <PDF source="doc2.pdf"/>

</PDF>

 

October 11, 2022

Hi Mayank,

 

Thank you for the response. Scale down with newX and newY are working for me for A4 sheet size. It is scaling down the PDF content and puts the content to the center of the PDF page. The same configuration is not working for other sheet sizes like A2, A3 etc., I want to scale down and recenter the PDF content for all sheet sizes with same ddx configuration.

Mayank_Gandhi
Adobe Employee
Adobe Employee
October 11, 2022

@pavan_mekala have you tried different values to see if its working on A2?

Pulkit_Jain_
Adobe Employee
Adobe Employee
October 12, 2022

@pavan_mekala 

One configuration won't fit all the use-case/input files in the case at hand.

You may have to update the DDX and scale each input accordingly to get the desired output if you have different input file sizes. Scaling down the input by 25% for A1 or A4 size will yield different results.

So to fine-tune the output, you should keep different DDXs for different input files.