Class PdfDocument_Api
java.lang.Object
com.ironsoftware.ironpdf.internal.staticapi.PdfDocument_Api
The type Pdf document api.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic InternalPdfDocument
fromBytes
(byte[] pdfFileBytes) Opens an existing PDF document for editing.static InternalPdfDocument
Opens an existing PDF document for editing.static InternalPdfDocument
Opens an existing PDF document for editing.static InternalPdfDocument
Opens an existing PDF document for editing.static InternalPdfDocument
Opens an existing PDF document for editing.static InternalPdfDocument
Opens an existing PDF document for editing.static byte[]
getBytes
(InternalPdfDocument internalPdfDocument, boolean isIncremental) Gets the binary data for the full PDF file as a byte array.static InternalPdfDocument
getRevision
(InternalPdfDocument internalPdfDocument, int index) Gets the binary data for the full PDF file as a byte array.static void
Save as.static void
saveAs
(InternalPdfDocument internalPdfDocument, String filePath) Save as.static void
saveAsRevision
(InternalPdfDocument internalPdfDocument, String filePath) Save as.
-
Constructor Details
-
PdfDocument_Api
public PdfDocument_Api()
-
-
Method Details
-
fromFile
Opens an existing PDF document for editing.- Parameters:
pdfFilePath
- The PDF file path.- Returns:
- An IronPdf.PdfDocument object as loaded from the file path.
- Throws:
IOException
- Exception thrown if it can not be opened.
-
fromFile
Opens an existing PDF document for editing.- Parameters:
pdfFilePath
- The PDF file path.password
- Optional user password if the PDF document is encrypted.- Returns:
- An IronPdf.PdfDocument object as loaded from the file path.
- Throws:
IOException
- Exception thrown if it can not be opened.
-
fromFile
public static InternalPdfDocument fromFile(String pdfFilePath, String password, String ownerPassword) throws IOException Opens an existing PDF document for editing.- Parameters:
pdfFilePath
- The PDF file path.password
- Optional user password if the PDF document is encrypted.ownerPassword
- Optional password if the PDF document is protected by owner (printing, modifying restrictions etc..)- Returns:
- An IronPdf.PdfDocument object as loaded from the file path.
- Throws:
IOException
- Exception thrown if it can not be opened.
-
fromBytes
public static InternalPdfDocument fromBytes(byte[] pdfFileBytes, String userPassword, String ownerPassword) Opens an existing PDF document for editing.- Parameters:
pdfFileBytes
- The PDF file data as byte array.userPassword
- Optional user password if the PDF document is encrypted.ownerPassword
- Optional password if the PDF document is protected by owner (printing, modifying restrictions etc..)- Returns:
- the internal pdf document
-
saveAs
public static void saveAs(InternalPdfDocument internalPdfDocument, String filePath) throws IOException Save as.- Parameters:
internalPdfDocument
- the internal pdf documentfilePath
- the file path- Throws:
IOException
- the io exception
-
saveAsRevision
public static void saveAsRevision(InternalPdfDocument internalPdfDocument, String filePath) throws IOException Save as. Saves current changes as a revision and returns the revised the document, optionally also saving the document to disk- Parameters:
internalPdfDocument
- the internal pdf documentfilePath
- the file path- Throws:
IOException
- the io exception
-
getBytes
Gets the binary data for the full PDF file as a byte array.- Parameters:
internalPdfDocument
- the internal pdf documentisIncremental
- isIncremental- Returns:
- the pdf byte array
-
getRevision
Gets the binary data for the full PDF file as a byte array.- Parameters:
internalPdfDocument
- the internal pdf documentindex
- revision index- Returns:
- the internal pdf document
-
saveAs
Save as.- Parameters:
pdfData
- the pdf datafilePath
- the file path- Throws:
IOException
- the io exception
-
fromBytes
Opens an existing PDF document for editing.- Parameters:
pdfFileBytes
- The PDF file data as byte array.userPassword
- Optional user password if the PDF document is encrypted.- Returns:
- the internal pdf document
-
fromBytes
Opens an existing PDF document for editing.- Parameters:
pdfFileBytes
- The PDF file data as byte array.- Returns:
- the internal pdf document
-