Hello,
I am trying to convert pdf to pdfa using the following coding.
The conversion seems fine without any exceptions.
But the two log files Conversion_log_.xml and Validation_log_.xml contain errors. The file name these log files is always test.pdf.
Since the contents in the log files do NOT reflect the real case, does Aspose.pdf hard-code the contents in the log files?
Attached are the input.pdf, output_pdfa_0.pdf, Conversion_log_0.xml and Validation_log_0.xml.
Thanks.
public static void main(String[] args) throws Exception {
static String dir_pdf2pdfa = "C:/temp/pdf/utilities/pdf2pdfa/";
ApplyLicense.setLicense();
/******* Convert PDF to PDFA *******/
pdfTopdfA1bConversion(PdfFormat.PDF_A_1A);
// pdfTopdfA1bConversion(PdfFormat.PDF_A_1B);
// pdfTopdfA1bConversion(PdfFormat.PDF_A_2A);
// pdfTopdfA1bConversion(PdfFormat.PDF_A_2B);
// pdfTopdfA1bConversion(PdfFormat.PDF_A_3A);
// pdfTopdfA1bConversion(PdfFormat.PDF_A_3B)
}
public static void pdfTopdfA1bConversion(int pdfFormat) {
// Open document
Document doc = new Document(dir_pdf2pdfa + "input.pdf");
// Convert to PDF/A compliant document
doc.validate(dir_pdf2pdfa + "Validation_log_" + pdfFormat + ".xml", pdfFormat);
doc.convert(dir_pdf2pdfa + "Conversion_log_" + pdfFormat + ".xml", pdfFormat, ConvertErrorAction.Delete);
// Save updated document
doc.save(dir_pdf2pdfa + "output_pdfa_" + pdfFormat + ".pdf");
}