Expand my Community achievements bar.

SOLVED

Scaledown PDF and recenter the content

Avatar

Level 1

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>

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@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

View solution in original post

6 Replies

Avatar

Employee Advisor

@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>

 

Avatar

Level 1

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.

Avatar

Employee Advisor

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

Avatar

Level 1

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.

Avatar

Correct answer by
Employee Advisor

@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

Avatar

Employee Advisor

@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.