Package org.pdfbox.pdmodel

Examples of org.pdfbox.pdmodel.PDDocument.save()


                    rs.setContents("A top secret note");
                   
                    annotations.add(rs);
                }
               
                document.save( args[1] );
            }
            finally
            {
                if( document != null )
                {
View Full Code Here


                PDDestination dest = item.getDestination();
                PDActionGoTo action = new PDActionGoTo();
                action.setDestination(dest);        
                document.getDocumentCatalog().setOpenAction(action);
               
                document.save( args[1] );
            }
            finally
            {
                if( document != null )
                {
View Full Code Here

                contentStream.endText();
                contentStream.close();
            }
           
           
            doc.save( outfile );
        }
        finally
        {
            if( doc != null )
            {
View Full Code Here

            contentStream.setFont(font, 12);
            contentStream.moveTextPositionByAmount(100, 700);
            contentStream.drawString(message);
            contentStream.endText();
            contentStream.close();
            doc.save(file);
            System.out.println(file + " created!");
        }
        finally
        {
            if (doc != null)
View Full Code Here

    {
                       
        PDDocument doc = PDDocument.load(input);
        protect(doc, publicCert1.getAbsolutePath());
       
        doc.save(output.getAbsolutePath());
           
        doc.close();
                       
        PDDocument doc2 = PDDocument.load(output);   
       
View Full Code Here

        PDDocument doc = PDDocument.load(input);
        protect(doc, publicCert1.getAbsolutePath());
       
        //Assert.assertTrue(doc.isEncrypted());
       
        doc.save(output.getAbsolutePath());
           
        doc.close();
                       
        PDDocument doc2 = PDDocument.load(output);
       
View Full Code Here

       
        ppp.addRecipient(recip1);
        ppp.addRecipient(recip2);
       
        doc.protect(ppp);               
        doc.save(output.getAbsolutePath());       
        doc.close();
       
        /* open first time */
       
        PDDocument docOpen1 = PDDocument.load(output);
View Full Code Here

                    }
                    document.openProtection(decryptionMaterial);
                    AccessPermission ap = document.getCurrentAccessPermission();
                    if(ap.isOwnerPermission())
                    {
                        document.save( outfile );
                    }
                    else
                    {
                        throw new IOException(
                        "Error: You are only allowed to decrypt a document with the owner password." );
View Full Code Here

                ByteArrayInputStream mdInput = new ByteArrayInputStream( xmp.toString().getBytes() );
                PDMetadata metadataStream = new PDMetadata(document, mdInput, false );
                catalog.setMetadata( metadataStream );
               
               
                document.save( args[1] );
            }
            finally
            {
                if( document != null )
                {
View Full Code Here

                                uri.setURI( newURI );
                            }
                        }
                    }
                }
                doc.save( args[1] );
            }
        }
        finally
        {
            if( doc != null )
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.