Package org.apache.pdfbox.pdfwriter

Examples of org.apache.pdfbox.pdfwriter.ContentStreamWriter.writeTokens()


                                int bmcIndex = tokens.indexOf(PDFOperator.getOperator("BMC"));
                                int emcIndex = tokens.indexOf(PDFOperator.getOperator("EMC"));

                                if (bmcIndex != -1)
                                {
                                    writer.writeTokens(tokens, 0, bmcIndex + 1);
                                }
                                else
                                {
                                    writer.writeTokens(tokens);
                                }
View Full Code Here


                                {
                                    writer.writeTokens(tokens, 0, bmcIndex + 1);
                                }
                                else
                                {
                                    writer.writeTokens(tokens);
                                }
                                output.write("\n".getBytes("ISO-8859-1"));
                                insertGeneratedAppearance(widget, output, pdFont, tokens, appearanceStream);
                                if (emcIndex != -1)
                                {
View Full Code Here

                                }
                                output.write("\n".getBytes("ISO-8859-1"));
                                insertGeneratedAppearance(widget, output, pdFont, tokens, appearanceStream);
                                if (emcIndex != -1)
                                {
                                    writer.writeTokens(tokens, emcIndex, tokens.size());
                                }
                            }
                            writeToStream(output.toByteArray(), appearanceStream);
                        }
                        else
View Full Code Here

            // BJL 9/25/2004 Must prepend existing stream
            // because it might have operators to draw things like
            // rectangles and such
            ContentStreamWriter writer = new ContentStreamWriter(output);
            writer.writeTokens(tokens);

            output.write(" /Tx BMC\n".getBytes("ISO-8859-1"));
            insertGeneratedListboxAppearance(fieldWidget, output, pdFont, tokens, appearanceStream);
            output.write(" EMC".getBytes("ISO-8859-1"));
            writeToStream(output.toByteArray(), appearanceStream);
View Full Code Here

                int emcIndex = tokens.indexOf(PDFOperator.getOperator("EMC"));

                if (bmcIndex != -1)
                {
                    writer.writeTokens(tokens, 0, bmcIndex + 1);
                }
                else
                {
                    writer.writeTokens(tokens);
                }
View Full Code Here

                {
                    writer.writeTokens(tokens, 0, bmcIndex + 1);
                }
                else
                {
                    writer.writeTokens(tokens);
                }
                output.write("\n".getBytes("ISO-8859-1"));
                insertGeneratedListboxAppearance(fieldWidget, output, pdFont, tokens, appearanceStream);
                if (emcIndex != -1)
                {
View Full Code Here

                }
                output.write("\n".getBytes("ISO-8859-1"));
                insertGeneratedListboxAppearance(fieldWidget, output, pdFont, tokens, appearanceStream);
                if (emcIndex != -1)
                {
                    writer.writeTokens(tokens, emcIndex, tokens.size());
                }

                writeToStream(output.toByteArray(), appearanceStream);
            }
            else
View Full Code Here

            if (fontIndex != -1)
            {
                daTokens.set(fontIndex - 1, new COSFloat(fontSize));
            }
            ContentStreamWriter daWriter = new ContentStreamWriter(output);
            daWriter.writeTokens(daTokens);
        }
       
        // Handle a field with the comb flag being set differently to
        // address PDFBOX-91
        // TODO: Shall be addressed properly in a future release
View Full Code Here

        printWriter.println("BT");

        if (defaultAppearance != null)
        {
            ContentStreamWriter daWriter = new ContentStreamWriter(output);
            daWriter.writeTokens(daTokens);
        }

        int q = getQ();
        if (q == PDTextbox.QUADDING_LEFT)
        {
View Full Code Here

            } // For each page token

            // We replace original page content by the edited one.
            PDStream updatedPageContents = new PDStream(inputFile);
            ContentStreamWriter contentWriter = new ContentStreamWriter( updatedPageContents.createOutputStream() );
            contentWriter.writeTokens( editedPageTokens );
            currentPage.setContents( updatedPageContents );

        } // For each document page
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.