@Test public void directionTest() { PdfViewerPreferences preferences = new PdfViewerPreferences(); PdfDictionary dictionary = preferences.getPdfObject(); Assert.assertEquals(0, dictionary.size()); preferences.setDirection(PdfViewerPreferences.PdfViewerPreferencesConstants.PRINT_AREA); Assert.assertEquals(0, dictionary.size()); preferences.setDirection(PdfViewerPreferences.PdfViewerPreferencesConstants.LEFT_TO_RIGHT); Assert.assertEquals(1, dictionary.size()); Assert.assertEquals(PdfName.L2R, dictionary.get(PdfName.Direction)); preferences.setDirection(PdfViewerPreferences.PdfViewerPreferencesConstants.RIGHT_TO_LEFT); Assert.assertEquals(1, dictionary.size()); Assert.assertEquals(PdfName.R2L, dictionary.get(PdfName.Direction)); }
public PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction) { switch (direction) { case LEFT_TO_RIGHT: put(PdfName.Direction, PdfName.L2R); break; case RIGHT_TO_LEFT: put(PdfName.Direction, PdfName.R2L); break; default: } return this; }
PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary> { public PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction) { switch (direction) { case LEFT_TO_RIGHT: put(PdfName.Direction, PdfName.L2R); break; case RIGHT_TO_LEFT: put(PdfName.Direction, PdfName.R2L); break; default: } return this; } }
PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary> { public PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction) { switch (direction) { case LEFT_TO_RIGHT: put(PdfName.Direction, PdfName.L2R); break; case RIGHT_TO_LEFT: put(PdfName.Direction, PdfName.R2L); break; default: } return this; } PdfViewerPreferences();  PdfViewerPreferences(PdfDictionary pdfObject); }
PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary> { public PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction) { switch (direction) { case LEFT_TO_RIGHT: put(PdfName.Direction, PdfName.L2R); break; case RIGHT_TO_LEFT: put(PdfName.Direction, PdfName.R2L); break; default: } return this; } PdfViewerPreferences();  PdfViewerPreferences(PdfDictionary pdfObject); PdfViewerPreferences setHideToolbar(boolean hideToolbar); PdfViewerPreferences setHideMenubar(boolean hideMenubar); PdfViewerPreferences setHideWindowUI(boolean hideWindowUI); PdfViewerPreferences setFitWindow(boolean fitWindow); PdfViewerPreferences setCenterWindow(boolean centerWindow); PdfViewerPreferences setDisplayDocTitle(boolean displayDocTitle); PdfViewerPreferences setNonFullScreenPageMode(PdfViewerPreferencesConstants nonFullScreenPageMode); PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction); PdfViewerPreferences setViewArea(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setViewClip(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintArea(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintClip(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintScaling(PdfViewerPreferencesConstants printScaling); PdfViewerPreferences setDuplex(PdfViewerPreferencesConstants duplex); PdfViewerPreferences setPickTrayByPDFSize(boolean pickTrayByPdfSize); PdfViewerPreferences setPrintPageRange(int[] printPageRange); PdfViewerPreferences setNumCopies(int numCopies); PdfViewerPreferences setEnforce(PdfArray enforce); PdfArray getEnforce(); PdfViewerPreferences put(PdfName key, PdfObject value); }
PdfViewerPreferences extends PdfObjectWrapper<PdfDictionary> { public PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction) { switch (direction) { case LEFT_TO_RIGHT: put(PdfName.Direction, PdfName.L2R); break; case RIGHT_TO_LEFT: put(PdfName.Direction, PdfName.R2L); break; default: } return this; } PdfViewerPreferences();  PdfViewerPreferences(PdfDictionary pdfObject); PdfViewerPreferences setHideToolbar(boolean hideToolbar); PdfViewerPreferences setHideMenubar(boolean hideMenubar); PdfViewerPreferences setHideWindowUI(boolean hideWindowUI); PdfViewerPreferences setFitWindow(boolean fitWindow); PdfViewerPreferences setCenterWindow(boolean centerWindow); PdfViewerPreferences setDisplayDocTitle(boolean displayDocTitle); PdfViewerPreferences setNonFullScreenPageMode(PdfViewerPreferencesConstants nonFullScreenPageMode); PdfViewerPreferences setDirection(PdfViewerPreferencesConstants direction); PdfViewerPreferences setViewArea(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setViewClip(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintArea(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintClip(PdfViewerPreferencesConstants pageBoundary); PdfViewerPreferences setPrintScaling(PdfViewerPreferencesConstants printScaling); PdfViewerPreferences setDuplex(PdfViewerPreferencesConstants duplex); PdfViewerPreferences setPickTrayByPDFSize(boolean pickTrayByPdfSize); PdfViewerPreferences setPrintPageRange(int[] printPageRange); PdfViewerPreferences setNumCopies(int numCopies); PdfViewerPreferences setEnforce(PdfArray enforce); PdfArray getEnforce(); PdfViewerPreferences put(PdfName key, PdfObject value);  }