Handling Errors During PDF/XPS Export
When you export a document to PDF or XPS format, you may encounter some specific errors:
- FREN_E_INVALID_CREATION_DATE_FORMAT;
- FREN_E_INVALID_MODIFICATION_DATE_FORMAT.
They appear if the creation or modification date specified in the document metadata does not comply with the PDF 2.0 standard. The correct date format is D:YYYYMMDDHHmmSSOHH'mm, where YYYY — the year, MM — the month, DD — the date, HHmmSS — the time, OHH'mm — the absolute value of the offset from Universal Time.
To handle errors of this type, you may either change the date export settings or correct the date to fit the format.
To change the date export settings:
- Get the DocumentContentInfoWritingParams subobject of the export parameters object for your output format:
- For PDF export, you can use the PDFFeatures property of the PDFExportParams object to access the PDFExportFeatures object, then use its MetaDataWritingParams property to get the DocumentContentInfoWritingParams object.
- For XPS export, use the MetaDataWritingParams property of the XPSExportParams object.
- The WriteCreationDate and WriteModificationDate properties of the DocumentContentInfoWritingParams object specify which dates should be saved into the output document. In this case, you may use the WD_No value to disable date saving and the WD_Current value to use the current date.
- Restart the document export using, for example, the Export method of the FRDocument object, passing the parameters object you have just set up as the last input parameter.
To correct the date:
- Access the DocumentСontentInfo object using the DocumentContentInfo property of the FRDocument object.
- Change the date in the CreationDate or ModificationDate property of the DocumentСontentInfo object.
- Restart the document export with the Export method of the FRDocument object.
Samples
C++ code
C# code
See also
17.09.2024 15:14:40