so first of all... is there a way to directly convert a file (which is not a pdf) to a pdf that is in PDF/A format? I've only seen examples with a export converter but that would be from pdf -> pdf/a.
Meanwhile i tried doing the following: convert file with import converter to a pdf file and afterwards using the export converter to convert it into pdf/a. The problem with that is, that my tool fails to validate the pdf/a conformance. If i use a printer or for example word to do the conversion to pdf and then convert it to pdf/a, the validation succeeds. So another question would be: Am i using the import converter wrong? Why does a resulting pdf fail to pass the validation?
I am doing the following:
Code: Select all
//converter is the corresponding import converter. this is working fine for over a year
IPXC_Document doc = converter.Convert(instance, file);
IString dest = instance.CreateString(destPath);
try
{
var pdfaConverter = GetPdfaConverter(instance);
ICab cab = instance.GetFormatConverterParams(false, "conv.exp.pdfa");
ICabNode node = cab.Root;
node.SetInt("Part", 3);
node.SetInt("Conformance", 1);
node.SetInt("ShowReport", 0);
node.SetString("ErrorMessage", "false");
pdfaConverter.Convert(instance, doc, dest, 0, cab);
}
catch (Exception ex)
{
//Log the error
//As a fallback, just write the pdf without converting to pdfa
doc.WriteToFile(destPath);
}
doc.Close();
Greetings,
Dennis