/** * Prepare the given PdfWriter. Called before building the PDF document, * that is, before the call to {@code Document.open()}. * <p>Useful for registering a page event listener, for example. * The default implementation sets the viewer preferences as returned * by this class's {@code getViewerPreferences()} method. * @param model the model, in case meta information must be populated from it * @param writer the PdfWriter to prepare * @param request in case we need locale etc. Shouldn't look at attributes. * @throws DocumentException if thrown during writer preparation * @see com.lowagie.text.Document#open() * @see com.lowagie.text.pdf.PdfWriter#setPageEvent * @see com.lowagie.text.pdf.PdfWriter#setViewerPreferences * @see #getViewerPreferences() */ protected void prepareWriter(Map<String, Object> model, PdfWriter writer, HttpServletRequest request) throws DocumentException { writer.setViewerPreferences(getViewerPreferences()); }
/** * Prepare the given PdfWriter. Called before building the PDF document, * that is, before the call to {@code Document.open()}. * <p>Useful for registering a page event listener, for example. * The default implementation sets the viewer preferences as returned * by this class's {@code getViewerPreferences()} method. * @param model the model, in case meta information must be populated from it * @param writer the PdfWriter to prepare * @param request in case we need locale etc. Shouldn't look at attributes. * @throws DocumentException if thrown during writer preparation * @see com.lowagie.text.Document#open() * @see com.lowagie.text.pdf.PdfWriter#setPageEvent * @see com.lowagie.text.pdf.PdfWriter#setViewerPreferences * @see #getViewerPreferences() */ protected void prepareWriter(Map<String, Object> model, PdfWriter writer, HttpServletRequest request) throws DocumentException { writer.setViewerPreferences(getViewerPreferences()); }
public void onClose(ITextRenderer renderer) { PdfWriter writer = renderer.getWriter(); if (writer == null) { log.warn("PdfWriter is null, not able to set header meta tags to PDF document"); return; } //Display doc title in the title bar instead of filename, writer.setViewerPreferences(PdfWriter.DisplayDocTitle); } }
/** * Prepare the given PdfWriter. Called before building the PDF document, * that is, before the call to {@code Document.open()}. * <p>Useful for registering a page event listener, for example. * The default implementation sets the viewer preferences as returned * by this class's {@code getViewerPreferences()} method. * @param model the model, in case meta information must be populated from it * @param writer the PdfWriter to prepare * @param request in case we need locale etc. Shouldn't look at attributes. * @throws DocumentException if thrown during writer preparation * @see com.lowagie.text.Document#open() * @see com.lowagie.text.pdf.PdfWriter#setPageEvent * @see com.lowagie.text.pdf.PdfWriter#setViewerPreferences * @see #getViewerPreferences() */ protected void prepareWriter(Map<String, Object> model, PdfWriter writer, HttpServletRequest request) throws DocumentException { writer.setViewerPreferences(getViewerPreferences()); }
/** * Prepare the given PdfWriter. Called before building the PDF document, * that is, before the call to <code>Document.open()</code>. * <p>Useful for registering a page event listener, for example. * The default implementation sets the viewer preferences as returned * by this class's <code>getViewerPreferences()</code> method. * @param model the model, in case meta information must be populated from it * @param writer the PdfWriter to prepare * @param request in case we need locale etc. Shouldn't look at attributes. * @throws DocumentException if thrown during writer preparation * @see com.lowagie.text.Document#open() * @see com.lowagie.text.pdf.PdfWriter#setPageEvent * @see com.lowagie.text.pdf.PdfWriter#setViewerPreferences * @see #getViewerPreferences() */ protected void prepareWriter(Map<String, Object> model, PdfWriter writer, HttpServletRequest request) throws DocumentException { writer.setViewerPreferences(getViewerPreferences()); }
private void writeOutline(RenderingContext c, Box root) { if (_bookmarks.size() > 0) { _writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); writeBookmarks(c, root, _writer.getRootOutline(), _bookmarks); } }
private void writeOutline(RenderingContext c, Box root) { if (_bookmarks.size() > 0) { _writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); writeBookmarks(c, root, _writer.getRootOutline(), _bookmarks); } }
private void writeOutline(RenderingContext c, Box root) { if (_bookmarks.size() > 0) { _writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); writeBookmarks(c, root, _writer.getRootOutline(), _bookmarks); } }
PdfWriter writer = PdfWriter.getInstance(document, outputStream); writer.setTransition(new PdfTransition(PdfTransition.DGLITTER, 2)); writer.setViewerPreferences(PdfWriter.PageModeFullScreen); writer.setDuration(2);
private void writeOutline(RenderingContext c, Box root) { if (_bookmarks.isEmpty()) { _bookmarks = HTMLOutline.generate(root.getElement(), root); } if (_bookmarks.size() > 0) { _writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); writeBookmarks(c, root, _writer.getRootOutline(), _bookmarks); } }
private void writeOutline(RenderingContext c, Box root) { if (_bookmarks.isEmpty()) { _bookmarks = HTMLOutline.generate(root.getElement(), root); } if (_bookmarks.size() > 0) { _writer.setViewerPreferences(PdfWriter.PageModeUseOutlines); writeBookmarks(c, root, _writer.getRootOutline(), _bookmarks); } }
writer.setViewerPreferences(PdfWriter.PageLayoutSinglePage);
writer.setViewerPreferences( getViewerPreferences() );