Package org.apache.pdfbox.pdfwriter

Examples of org.apache.pdfbox.pdfwriter.COSWriter


     * @throws IOException If there is an error writing the document.
     * @throws COSVisitorException If an error occurs while generating the data.
     */
    public void save( OutputStream output ) throws IOException, COSVisitorException
    {
        COSWriter writer = null;
        try
        {
            writer = new COSWriter( output );
            writer.write( document );
            writer.close();
        }
        finally
        {
            if( writer != null )
            {
                writer.close();
            }
        }
    }
View Full Code Here


        merger.appendDocument(destination, tmpDocument);
      }

      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      COSWriter writer = new COSWriter(bos);
      writer.write(destination);

      for (PDDocument doc : list) {
        doc.close();
      }
View Full Code Here

      InputStream[] array = new InputStream[list.size()];

      for (int i = 0; i < list.size(); i++) {
        PDDocument d = list.get(i);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        COSWriter writer = new COSWriter(bos);
        writer.write(d);
        array[i] = new ByteArrayInputStream(bos.toByteArray());
        d.close();
      }
      document.close();
View Full Code Here

        merger.appendDocument(destination, tmpDocument);
      }

      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      COSWriter writer = new COSWriter(bos);
      writer.write(destination);

      for (PDDocument doc : list) {
        doc.close();
      }
View Full Code Here

      InputStream[] array = new InputStream[list.size()];

      for (int i = 0; i < list.size(); i++) {
        PDDocument d = list.get(i);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        COSWriter writer = new COSWriter(bos);
        writer.write(d);
        array[i] = new ByteArrayInputStream(bos.toByteArray());
        d.close();
      }
      document.close();
View Full Code Here

     */
    public void save( OutputStream output ) throws IOException, COSVisitorException
    {
        //update the count in case any pages have been added behind the scenes.
        getDocumentCatalog().getPages().updateCount();
        COSWriter writer = null;
        try
        {
            writer = new COSWriter( output );
            writer.write( this );
            writer.close();
        }
        finally
        {
            if( writer != null )
            {
                writer.close();
            }
        }
    }
View Full Code Here

     */
    public void save( OutputStream output ) throws IOException, COSVisitorException
    {
        //update the count in case any pages have been added behind the scenes.
        getDocumentCatalog().getPages().updateCount();
        COSWriter writer = null;
        try
        {
            writer = new COSWriter( output );
            writer.write( this );
            writer.close();
        }
        finally
        {
            if( writer != null )
            {
                writer.close();
            }
        }
    }
View Full Code Here

     */
    public void saveIncremental( FileInputStream input, OutputStream output ) throws IOException, COSVisitorException
    {
        //update the count in case any pages have been added behind the scenes.
        getDocumentCatalog().getPages().updateCount();
        COSWriter writer = null;
        try
        {
            // Sometimes the original file will be missing a newline at the end
            // In order to avoid having %%EOF the first object on the same line
            // as the %%EOF, we put a newline here.  If there's already one at
            // the end of the file, an extra one won't hurt. PDFBOX-1051
            output.write("\r\n".getBytes());
            writer = new COSWriter( output, input );
            writer.write( this );
            writer.close();
        }
        finally
        {
            if( writer != null )
            {
                writer.close();
            }
        }
    }
View Full Code Here

     */
    public void save( OutputStream output ) throws IOException, COSVisitorException
    {
        //update the count in case any pages have been added behind the scenes.
        getDocumentCatalog().getPages().updateCount();
        COSWriter writer = null;
        try
        {
            writer = new COSWriter( output );
            writer.write( this );
            writer.close();
        }
        finally
        {
            if( writer != null )
            {
                writer.close();
            }
        }
    }
View Full Code Here

        merger.appendDocument(destination, tmpDocument);
      }

      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      COSWriter writer = new COSWriter(bos);
      writer.write(destination);

      for (PDDocument doc : list) {
        doc.close();
      }
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdfwriter.COSWriter

Copyright © 2018 www.massapicom. 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.