/** * Create a new appearance stream. * * @param appearance * The appearance stream to write to. * @throws IOException If there is an error writing to the content stream. */ public PDAppearanceContentStream(PDAppearanceStream appearance) throws IOException { this(appearance, appearance.getStream().createOutputStream()); }
/** * Create a new appearance stream. Note that this is not actually a "page" content stream. * * @param doc The document the page is part of. * @param appearance The appearance stream to write to. * @throws IOException If there is an error writing to the page contents. */ public PDPageContentStream(PDDocument doc, PDAppearanceStream appearance) throws IOException { this (doc, appearance, appearance.getStream().createOutputStream()); }
/** * Create a new appearance stream. * * @param appearance The appearance stream to write to. * @param compress whether the content stream is to be compressed. Set this to true when * creating long content streams. * @throws IOException If there is an error writing to the content stream. */ public PDAppearanceContentStream(PDAppearanceStream appearance, boolean compress) throws IOException { this(appearance, appearance.getStream().createOutputStream(compress ? COSName.FLATE_DECODE : null)); }
/** * Create a new appearance stream. Note that this is not actually a "page" content stream. * * @param doc The document the page is part of. * @param appearance The appearance stream to write to. * @throws IOException If there is an error writing to the page contents. */ public PDPageContentStream(PDDocument doc, PDAppearanceStream appearance) throws IOException { this (doc, appearance, appearance.getStream().createOutputStream()); }
/** * Create a new appearance stream. * * @param appearance * The appearance stream to write to. * @throws IOException * If there is an error writing to the page contents. */ public PDAppearanceContentStream(PDAppearanceStream appearance) throws IOException { this(appearance, appearance.getStream().createOutputStream()); }
/** * Create a new appearance stream. Note that this is not actually a "page" content stream. * * @param doc The document the page is part of. * @param appearance The appearance stream to write to. * @throws IOException If there is an error writing to the page contents. */ public PDPageContentStream(PDDocument doc, PDAppearanceStream appearance) throws IOException { this (doc, appearance, appearance.getStream().createOutputStream()); }
/** * Create a new appearance stream. * * @param appearance The appearance stream to write to. * @throws IOException If there is an error writing to the page contents. */ public PDAbstractContentStream(PDAppearanceStream appearance) throws IOException { this (appearance, appearance.getStream().createOutputStream()); }
void saveFieldValue( PDField field ) throws IOException { PDDocument document = getDocument( field ); // see PDField.getWidget() for( PDAnnotationWidget widget : getWidgets( field ) ) { PDPage parentPage = getPage( widget ); try (PDPageContentStream contentStream = new PDPageContentStream( document, parentPage, true, true )) { writeContent( contentStream, widget ); } } } void writeContent( PDPageContentStream contentStream, PDAnnotationWidget widget ) throws IOException { PDAppearanceStream appearanceStream = getAppearanceStream( widget ); PDXObject xobject = new PDXObjectForm( appearanceStream.getStream() ); AffineTransform transformation = getPositioningTransformation( widget.getRectangle() ); contentStream.drawXObject( xobject, transformation ); }
processSubStream( page, appearance.getResources(), appearance.getStream() ); g.translate( (int)-rect.getLowerLeftX(), (int)+rect.getLowerLeftY() );