Skip to main content
davidt12412601
Inspiring
April 13, 2022
Answered

Alignment of text in print PDFs

  • April 13, 2022
  • 2 replies
  • 1865 views

When exporting an InDesign file to a print PDF, I'm finding that regardless of the horizontal alignment setting for the text frame in InDesign (left, right, or centered), the text frame in the PDF is always left aligned and the entire frame is just positioned so the text looks visually centered or right-aligned if necessary.

 

I'm trying to build template PDFs in which some strings (e.g., prices in a table) are modified by JavaScript after export. The problem arises that if the replacement string is not the same length as the original string, then the text is no longer centered or right-aligned in the column.

 

I see that the alignment of a text frame can be set from the UI inside Acrobat. Is there a way to set the alignment of a PDF text frame at the time of export from InDesign? Or programmatically in the exported PDF?

 

Thanks!

This topic has been closed for replies.
Correct answer Willi Adelberger

Not all form functionalities can be done in InDesign. For several properties you have to go to Acrobat Pro to finish the task. Adobe has extended the possibilites to form properties a little bit, but there is much space for Adobe to impfove the possibilites as you have seen. Sorry.

2 replies

Willi Adelberger
Community Expert
Willi AdelbergerCommunity ExpertCorrect answer
Community Expert
April 15, 2022

Not all form functionalities can be done in InDesign. For several properties you have to go to Acrobat Pro to finish the task. Adobe has extended the possibilites to form properties a little bit, but there is much space for Adobe to impfove the possibilites as you have seen. Sorry.

BobLevine
Community Expert
Community Expert
April 14, 2022

Screenshots as well as how you're viewing this would be helpful. Also, this sounds more like an interactive pdf with form fields than a print pdf.

davidt12412601
Inspiring
April 18, 2022

Here's a simple screenshot. Our actual situation is a bit more compicated, but this demonstrates the issue. The prices in this table are centered in InDesign. We export using a print PDF profile. As you can see, the text on the page is actually left aligned within its frame. We're trying to programatically edit prices in a large number of exported PDFs, rather than re-export each time prices change, but we can't maintain centering of the new content since the text is actually left aligned. The same problem occurs with right alighment. The text frames are positioned to visually look right aligned, but the text within is actually left aligned.

Brad @ Roaring Mouse
Community Expert
Community Expert
April 18, 2022

The "alignment" inside the PDF has no correlation to the structure of your InDesign file. The PDF ONLY contains the instructions necessary to print or display the document. For instance, the word "Price" will start with the letter "P" at x,y location on the page, and the letters after it will follow, so the alignment of copy will always be from the left "starting point".

If you want to see how this works, open the file in Illustrator and you will see how the text is broken down into pieces. Even one line of type may be broken up into further smaller chunks and this is usually due to kerning, as the PDF needs to "back up" and start again, with a new location for the next letter.