Syntax 3: For a PDFDocument object
Description
Saves a PDFDocument object as a PDF document.
Applies to
Syntax
|
1 |
objectname.Save (string fileName) |
|
1 |
objectname.Save (string fileName, PDFStandard standard) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the PDFDocument object in which you want to |
|
fileName |
The name of the PDF document to be saved (including the |
|
standard |
The PDFStandard is the enumerated data type indicating
|
Return value
Long.
Returns 1 if the function succeeds and a negative value if an
error occurs. For more errors, see the Error Codes.
Usage
When the PDF document to be saved does not meet the rules of
password setting (refer to the security in Objects and Controls property), the save fails. This is
different from saving PDF output using PDFlib or GhostScript (depending
on which one is set as the default method) by which the setting of
password permission is ignored and the document is saved
successfully.
When saving the contents to a PDF document using PDF/A standard,
the security property is not compatible because the properties such as
the password and restrictions are not supported in the PDF/A
standard.These properties will be ignored and not appear in the PDF
output. But there is one special case: if the imported PDF document does
not meet the PDF/A standard, the save fails.
The table shows the compatibility between the supported PDF/A
standards:
| PDF/A standard compatibility | PDFA_1a! | PDFA_1b! | PDFA_3a! | PDFA_3b! | PDFA_3u! |
|---|---|---|---|---|---|
| PDFA_1a! | Yes | No | No | No | No |
| PDFA_1b! | Yes | Yes | No | No | No |
| PDFA_3a! | Yes | No | Yes | No | No |
| PDFA_3b! | Yes | Yes | Yes | Yes | Yes |
| PDFA_3u! | Yes | No | Yes | No | Yes |
Example 1
This example imports all pages of the PDF source document
noannotsnoPwd.pdf and saves the contents to a new PDF document called
save.pdf.
|
1 2 3 4 5 6 7 8 9 10 |
PDFDocument lpdf_doc long ll_return,ll_return1 lpdf_doc = Create PDFDocument ll_return = lpdf_doc.importpdf( "D: oannotsnoPwd.pdf") ll_return1 = lpdf_doc.save( "D:save.pdf") destroy lpdf_doc |
Example 2
This example imports all pages of the PDF source document
standard_3a.pdf and saves the contents to a new PDF document called
save_3A.pdf using PDFA_3A! standard.
|
1 2 3 4 5 6 7 8 9 10 |
PDFDocument lpdf_doc long ll_return,ll_return1 lpdf_doc = Create PDFDocument //refers to compatible PDF/A input levels for various PDF/A output levels ll_return = lpdf_doc.importpdf( "D:standard_3a.pdf") ll_return1 = lpdf_doc.save( "D:save_3A.pdf",PDFA_3A!) destroy lpdf_doc |
See also