IText: Setting default PDF viewing options

I use iText for a little manipulation of my PDF files through Java, and I would like to have the PDF file open by default, so that a single page fits into the window that opens, that this window is preferably filled with a screen, and that it has a thumbnail with left side. I know that other programs can set these viewing options, so I assume that iText can, but I did not understand how or what part of the API I should look at. Do you have any suggestions?

Greetings

Nick

+3
source share
1 answer

You must use setViewPreferencesthe PdfWriter class. Example:

writer.setViewerPreferences(PdfWriter.FitWindow 
  | PdfWriter.PageModeUseThumbs);

/ , , PdfWriter.HideToolbar; , , PdfWriter.PageModeFullScreen. ara -, |.

+6

Source: https://habr.com/ru/post/1753319/


All Articles