/** * Gets the indirect reference to this file specification. * Multiple invocations will retrieve the same value. * @throws IOException on error * @return the indirect reference */ public PdfIndirectReference getReference() throws IOException { if (ref != null) return ref; ref = writer.addToBody(this).getIndirectReference(); return ref; }
protected PdfIndirectReference add(final PdfICCBased icc) { PdfIndirectObject object; try { object = addToBody(icc); } catch(IOException ioe) { throw new ExceptionConverter(ioe); } return object.getIndirectReference(); }
PdfIndirectReference getReference() { try { if (reference == null) { reference = writer.addToBody(dictionary).getIndirectReference(); } } catch (IOException ioe) { throw new ExceptionConverter(ioe); } return reference; }
PdfIndirectReference getReference() { try { if (reference == null) { reference = writer.addToBody(dictionary).getIndirectReference(); } } catch (IOException ioe) { throw new ExceptionConverter(ioe); } return reference; }
void addJavaScript(final PdfAction js) { if (js.get(PdfName.JS) == null) throw new RuntimeException(MessageLocalization.getComposedMessage("only.javascript.actions.are.allowed")); try { documentLevelJS.put(SIXTEEN_DIGITS.format(jsCounter++), writer.addToBody(js).getIndirectReference()); } catch (IOException e) { throw new ExceptionConverter(e); } } void addJavaScript(final String name, final PdfAction js) {
void addJavaScript(final PdfAction js) { if (js.get(PdfName.JS) == null) throw new RuntimeException(MessageLocalization.getComposedMessage("only.javascript.actions.are.allowed")); try { documentLevelJS.put(SIXTEEN_DIGITS.format(jsCounter++), writer.addToBody(js).getIndirectReference()); } catch (IOException e) { throw new ExceptionConverter(e); } } void addJavaScript(final String name, final PdfAction js) {
/** * Writes the outline tree to the body of the PDF document. */ void writeOutlines() throws IOException { if (rootOutline.getKids().size() == 0) return; outlineTree(rootOutline); writer.addToBody(rootOutline, rootOutline.indirectReference()); }
/** * Writes the outline tree to the body of the PDF document. */ void writeOutlines() throws IOException { if (rootOutline.getKids().size() == 0) return; outlineTree(rootOutline); writer.addToBody(rootOutline, rootOutline.indirectReference()); }
void addJavaScript(final String name, final PdfAction js) { if (js.get(PdfName.JS) == null) throw new RuntimeException(MessageLocalization.getComposedMessage("only.javascript.actions.are.allowed")); try { documentLevelJS.put(name, writer.addToBody(js).getIndirectReference()); } catch (IOException e) { throw new ExceptionConverter(e); } }
void addJavaScript(final String name, final PdfAction js) { if (js.get(PdfName.JS) == null) throw new RuntimeException(MessageLocalization.getComposedMessage("only.javascript.actions.are.allowed")); try { documentLevelJS.put(name, writer.addToBody(js).getIndirectReference()); } catch (IOException e) { throw new ExceptionConverter(e); } }
protected void addXFormsToBody() throws IOException { for (Object objs[] : formXObjects.values()) { PdfTemplate template = (PdfTemplate)objs[1]; if (template != null && template.getIndirectReference() instanceof PRIndirectReference) continue; if (template != null && template.getType() == PdfTemplate.TYPE_TEMPLATE) { addToBody(template.getFormXObject(compressionLevel), template.getIndirectReference()); } } }
/** * Sets the document level additional actions. * @param actions dictionary of actions */ void setAdditionalActions(final PdfDictionary actions) { try { put(PdfName.AA, writer.addToBody(actions).getIndirectReference()); } catch (Exception e) { throw new ExceptionConverter(e); } } }
/** * Sets the document level additional actions. * @param actions dictionary of actions */ void setAdditionalActions(final PdfDictionary actions) { try { put(PdfName.AA, writer.addToBody(actions).getIndirectReference()); } catch (Exception e) { throw new ExceptionConverter(e); } } }
protected void addXFormsToBody() throws IOException { for (Object objs[] : formXObjects.values()) { PdfTemplate template = (PdfTemplate)objs[1]; if (template != null && template.getIndirectReference() instanceof PRIndirectReference) continue; if (template != null && template.getType() == PdfTemplate.TYPE_TEMPLATE) { addToBody(template.getFormXObject(compressionLevel), template.getIndirectReference()); } } }
public void addToBody() throws IOException { if (bBox != null) shading.put(PdfName.BBOX, new PdfArray(bBox)); if (antiAlias) shading.put(PdfName.ANTIALIAS, PdfBoolean.PDFTRUE); writer.addToBody(shading, getShadingReference()); }
public void addToBody() throws IOException { if (bBox != null) shading.put(PdfName.BBOX, new PdfArray(bBox)); if (antiAlias) shading.put(PdfName.ANTIALIAS, PdfBoolean.PDFTRUE); writer.addToBody(shading, getShadingReference()); }
protected void writeOutlines(final PdfDictionary catalog, final boolean namedAsNames) throws IOException { if (newBookmarks == null || newBookmarks.isEmpty()) return; PdfDictionary top = new PdfDictionary(); PdfIndirectReference topRef = getPdfIndirectReference(); Object kids[] = SimpleBookmark.iterateOutlines(this, topRef, newBookmarks, namedAsNames); top.put(PdfName.FIRST, (PdfIndirectReference)kids[0]); top.put(PdfName.LAST, (PdfIndirectReference)kids[1]); top.put(PdfName.COUNT, new PdfNumber(((Integer)kids[2]).intValue())); addToBody(top, topRef); catalog.put(PdfName.OUTLINES, topRef); }
protected void writeOutlines(final PdfDictionary catalog, final boolean namedAsNames) throws IOException { if (newBookmarks == null || newBookmarks.isEmpty()) return; PdfDictionary top = new PdfDictionary(); PdfIndirectReference topRef = getPdfIndirectReference(); Object kids[] = SimpleBookmark.iterateOutlines(this, topRef, newBookmarks, namedAsNames); top.put(PdfName.FIRST, (PdfIndirectReference)kids[0]); top.put(PdfName.LAST, (PdfIndirectReference)kids[1]); top.put(PdfName.COUNT, new PdfNumber(((Integer)kids[2]).intValue())); addToBody(top, topRef); catalog.put(PdfName.OUTLINES, topRef); }
public void addToBody() throws IOException { put(PdfName.SHADING, getShadingReference()); put(PdfName.MATRIX, new PdfArray(matrix)); writer.addToBody(this, getPatternReference()); }
public void addToBody() throws IOException { put(PdfName.SHADING, getShadingReference()); put(PdfName.MATRIX, new PdfArray(matrix)); writer.addToBody(this, getPatternReference()); }