In this case the original files are in .rtf format and they are converted to pdf/a (PDF_A_1A) using the methods below.
It seems as if documents converted to pdf/a 1a do not conform to the specs, and in some cases this causes print to fail.
When we validate the generated files using online validation tools they report numerous errors and if you open the generated files using a text editor you will notice that the pdf version is 1.5 even though pfd/a 1a should be of version 1.4 according to the specs.
I have attached the .rtf-file you requested.
public static MemoryStream DocToPdfa(Stream fileToConvert, Aspose.Pdf.PdfFormat pf = Aspose.Pdf.PdfFormat.PDF_A_1A)
{
using (MemoryStream d = new MemoryStream())
{
new Aspose.Words.Document(fileToConvert).Save(d, Aspose.Words.SaveFormat.Pdf);
d.Position = 0;
return PdfToPdfa(d, pf);
}
}
public static MemoryStream PdfToPdfa(Stream fileToConvert, Aspose.Pdf.PdfFormat pf = Aspose.Pdf.PdfFormat.PDF_A_1A)
{
MemoryStream d = new MemoryStream();
try
{
using (Aspose.Pdf.Document p = new Aspose.Pdf.Document(fileToConvert))
{
using (MemoryStream l = new MemoryStream())
{
if (p.Convert(l, pf, Aspose.Pdf.ConvertErrorAction.Delete))
{
p.Save(d);
d.Position = 0;
return d;
}
else
{
l.Position = 0;
using (StreamReader sr = new StreamReader(l))
{
throw new Exception(sr.ReadToEnd());
}
}
}
}
}
catch (Exception ex)
{
d.Dispose();
throw ex;
}
}
Thank you very much for your help!
Best regards,
Håkan