Copy link to clipboard
Copied
Hi all ,i am new to this community ,
I am encountering an issue when attempting to save a PDF document using the PDDocSave function with the PDSaveCopy flag. The save operation fails with an "error opening the specified document" error for older PDFs (e.g., those beginning with %PDF-1.3), but works without issue for newer PDFs (e.g., %PDF-1.6).
Observations:
When I use other flags such as "PDSaveFull or PDSaveForceIncremental" operation on the problematic document using Adobe Acrobat Sdk, a new copy is created that works correctly with PDDocSave .This suggests that the "PDDocSave" process updates the document's internal structure to a newer version, effectively resolving the incompatibility.
The call causing the issue is: PDDocSave(doc, PDSaveCopy, asPath, ASGetDefaultFileSys(), NULL, NULL);
Core Question:
What is the recommended method to programmatically upgrade or adapt an opened document's internal PDF version to a more recent, compatible version before performing operations like PDDocSave with the PDSaveCopy flag?
Request:
I am looking for the best practice to ensure a document's compatibility before executing subsequent actions, thereby preventing these version-related errors.
ASPathName asPath = ASFileSysCreatePathFromCString(ASGetDefaultFileSys(), nfn);
if (!asPath)
throw 0;
PDDocSave(doc, PDSaveCopy, asPath, ASGetDefaultFileSys(), NULL, NULL);
PDDoc copyDoc = PDDocOpen(asPath, ASGetDefaultFileSys(), NULL, true);
Copy link to clipboard
Copied
All of the Acrobat save operations perform some type of modification on the PDF. For the SaveAsCopy, all internal objects associated with Reader Extensions are removed. So it's not really a clean copy that is saved. Acrobat always has it's fingers in the PDF file, which means upgrading the version.
I have never seen the issue you've described. I suspect that it is a bug, so that there aren't any real best practices for saveing as a copy.
There are other issues around the SaveAsCopy functionality in other modalities. For example this option is no longer available on the "File" menu. The only way I've found to access this functionality from the UI is indirectly by forcing operations that are not allowed on signed PDFs. The SaveAsCopy flag in the doc.saveAs() JavaScript function does not work correctly. So there might be something about changes in the internal SaveAs thats got an issue. The issues I've mentioned imply that the SaveAsCopy functionality has been partially removed.
But you say that using other flags with PDSaveCopy gets it to work properly? Then it sounds like you have a solution.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now