[ 
https://issues.apache.org/jira/browse/PDFBOX-5237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17379028#comment-17379028
 ] 

Michael Klink commented on PDFBOX-5237:
---------------------------------------

Have you tried also setting the *Direction* entry in the viewer preferences 
dictionary to *R2L*?

According to the spec:


||Key||Type||Value||
|*Direction*|name|_(Optional; PDF 1.3)_ The predominant logical content order 
for text:
_L2R_ Left to right
_R2L_ Right to left (including vertical writing systems, such as Chinese, 
Japanese, and Korean)
This entry has no direct effect on the document’s contents or page numbering 
but may be used to determine the relative positioning of pages when displayed 
side by side or printed _n_-up. Default value: _L2R_.|

_(ISO 32000-2:2020 Table 147 — Entries in a viewer preferences dictionary)_

> PageLayout.TWO_COLUMN_RIGHT is not working as expected
> ------------------------------------------------------
>
>                 Key: PDFBOX-5237
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5237
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.24
>            Reporter: Ibrahim
>            Priority: Major
>         Attachments: 6Pages-PageLayout-TwoColumn.png, 
> 6Pages-PageLayout-TwoColumnRight.png, 6pages-PageLayout-TwoColumnLeft.pdf, 
> 6pages-PageLayout-TwoColumnRight.pdf, 6pages-PageLayout-TwoPageLeft.pdf, 
> 6pages-PageLayout-TwoPageRight.pdf, screenshot-1.png
>
>
> applying the following code:
> {code:java}
> final PDDocument document = Loader.loadPDF(new 
> File("C:/Users/Ebrahim/Desktop/hafs.pdf"));
> final PDDocumentCatalog docCatalog = document.getDocumentCatalog();
> docCatalog.setPageLayout(PageLayout.TWO_COLUMN_RIGHT);
> document.save("C:/Users/Ebrahim/Desktop/hafs_new.pdf");
> document.close();
> {code}
> to this file:
> [https://maknoon.com/hafs.pdf]
>  
> resulted in 'odd' pages to the left (using SumatraPDF) where it should be to 
> the right.
> using adobe reader, the first page is displayed alone and then odd pages to 
> the left, this resulted in very strange ordering for the pages.
> what i need is to display odd number to the right so that pages (for RTL 
> language) can be displayed as follow:
> #####
> 2    1
> 4    3
> 6    5



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to