4

I was wondering whether anyone knew the proper PDF metadata key (and value) in order to signify to PDF readers that the PDF in facing mode should be displayed from right-to-left (RTL) and not left-to-right. I use many Arabic PDFs (mainly scanned, not typed) and apparently no one encodes them properly (or whatever software they are using does not support the feature). I would like to edit the metadata so I can view pages in facing mode properly.

(I assume somebody who creates PDFs of Japanese manga, as well as Hebrew etc. documents would know this. I was unable to find a real PDF specification regarding this.)

Thank you

Hennes
  • 65,804
  • 7
  • 115
  • 169
Imran
  • 41

2 Answers2

0

According to Adobe's PDF Reference (3rd edition), setting the Direction key under ViewerPreferences to R2L will set a right-to-left reading order.

Omer Mor
  • 101
0

As Omer linked it is very simple to tell ACROBAT to use R2L

For Hebrew it could look something like this.

2 0 obj
<</Lang(he-IL)/Metadata 3 0 R/Pages 4 0 R/Type/Catalog/ViewerPreferences<</Direction/R2L>>>>
endobj

HOWEVER as it shows it is like many PDF features a user "ViewerPreference" so needs to be switched on in a Reader, and some do not have file scripts controlling viewer application switching for securities sake.

Thus very easy to edit a PDF to include it but will not ensure your reader respects it, Acrobat Reader Viewer Preferences will need you to accept PDFs can change your views by itself.

So how its done in other readers (so not browsers) is they will have a user controlled Manga Mode like this currently set to "Book Mode" (separate cover first) and similar for "Facing Mode".

enter image description here

For more details see https://stackoverflow.com/a/76775303/10802527

So to make the changes you need a program that if the entry is present could switch Type/Catalog say from /ViewerPreferences<</Direction/L2R>> to /ViewerPreferences<</Direction/R2L>> Say

cpdf in.pdf -replace-dict-entry /ViewerPreferences -replace-dict-entry-value '{"/Direction": {"N": "/R2L"}}' -o out.pdf

One big problem is most files do not have /ViewerPreferences<</Direction/L2R>> they simply rely on the user setting their own secure choices.

And even if you were to add it in, many readers would not have the ability to swap bindings.

K J
  • 1,248