Convert PDF to PDF/A Error

When we try to convert PDF files to PDF/A file, the errors occurred as below.
The original file is 'a.pdf'.
#1. The image in PDF file has changed position and broken. See 'a_out1.pdf'.
#2. It couldn't save to PDF/A format.
#3. There was NULL POINT EXCEPTION error from some of PDF files.

The source code was much the same between below and your sample(http://www.aspose.com/docs/display/pdfnet/Convert+PDF+File+to+PDF-A).

private void button1_Click(object sender, RoutedEventArgs e)
{

Aspose.Pdf.License license = new Aspose.Pdf.License();

license.SetLicense(@"c:\batch\Aspose.Pdf.lic");

string sfilename = @"c:\Batch\am.pdf";

string sfilename_out = @"c:\Batch\am_out1.pdf";


Document pdfDocument = new Document(sfilename);

// Convert to PDF/A compliant document

//during conversion process, the validation is also performed

//pdfDocument.Validate(sfilename_out,PdfFormat.PDF_A_1B);

pdfDocument.Convert(@"C:\Batch\log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

//pdfDocument.Convert("log.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

// Save output document

pdfDocument.Save(sfilename_out);

Please let us know the solution for these errors.
Thank you.

Hi there,

Thanks for your inquriy. We have tested the shared PDF documents and noticed the image rendering issue and NullReference exception, so logged following issues in our issue tracking system. We will notify you as soon as these are resolved.


PDFNEWNET-40678: Signature image rendering issue (a.pdf)

PDFNEWNET-40688: NullReference Exception issue (am.pdf.)


We are sorry for the inconvenience caused.

Best Regards,

Hello,
I want to tell you more information.
I am a member of your reseller in South Korea and the error appeared on our client.
The client said, it is working well on competitive products such as Adobe Acrobat DC or E-iceblue Tool.
Also, their project due date is soon so they hope to receive quick fix or refund.
Please let me know how much time you need.
I ask your favour.

Thank you in advance.

Best Regards,
Hyunmook Roh

Hi Hyunmook,


Thanks for your feedback. The issues are reported recently and these are pending for investigation in the queue with other issues, so I am afraid we can not share any ETA before the analysis. We have recorded your concern and requested our product to investigate and share an ETA asap. We will keep you updated about the issues’ resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Thank you for your help and details.
Please keep update the progress.
The due date is April but I will negotiate with them using your updates.

Thank you.

Best Regards,
Hyunmook Roh

Hi Hyunmook,


Thanks for your feedback. Sure, we will keep you updated about the issue resolution progress.

Best Regards,

Can you please provide ‘Fix Plan Date’ for the bug fix?
Per this issue, the user is having problem, holding all the setbacks in the development and related works.

Hi,

On Java, we have the same issues, please find the error below and the file:
class com.aspose.pdf.internal.ms.System.z10: Value cannot be null.
Parameter name: key
com.aspose.pdf.internal.p554.z2.tryGetValue(Unknown Source)
com.aspose.pdf.internal.p9.z1.m1(Unknown Source)
com.aspose.pdf.internal.p14.z5$z1.m1(Unknown Source)
com.aspose.pdf.internal.p66.z2.m1(Unknown Source)
com.aspose.pdf.internal.p93.z6.m3(Unknown Source)
com.aspose.pdf.internal.p93.z6.m1(Unknown Source)
com.aspose.pdf.internal.p93.z6.m1(Unknown Source)
com.aspose.pdf.internal.p93.z6.m17(Unknown Source)
com.aspose.pdf.internal.p93.z6.m2(Unknown Source)
com.aspose.pdf.internal.p93.z7.m12(Unknown Source)
com.aspose.pdf.internal.p93.z6.m1(Unknown Source)
com.aspose.pdf.ADocument.m1(Unknown Source)
com.aspose.pdf.Document.m1(Unknown Source)
com.aspose.pdf.ADocument.convertInternal(Unknown Source)
com.aspose.pdf.Document.convertInternal(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
com.ideosante.document.PDFDocument.convertByAspose(PDFDocument.java:65)
com.ideosante.document.AsposeDocumentImpl.convert(AsposeDocumentImpl.java:65)
com.ideosante.Converter.convert(Converter.java:35)
com.ideosante.ConverterTest.allPdfToPDF(ConverterTest.java:592)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
org.junit.runners.ParentRunner.run(ParentRunner.java:292)
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Hi Florian,

Thanks for your inquiry. Your issue does not relates to above reported issue. It seems you are getting issue on Linux OS, as some of the customers noticed similar exception on Linux. I have converted your PDF to PDFA on Linux(Ubuntu) and unable to notice the reported issue. It seems Aspose.Pdf for Java is unable to find fonts on your system. Please note on non-Windows OSs Aspose.Pdf for Java looks fonts in system default font path or specified local font path for custom font directory.

Please note most of the PDF documents that we convert are created by people using Windows or Mac OS operating systems with fonts that are installed with Microsoft Windows or with Microsoft Office. Can you please install Microsoft fonts on your system or copy fonts from your windows OS and paste to your system default font path, and try the code again? Hopefully it will resolve the issue.

Furthermore, if you want to use custom fonts from other than system default font path then you need to add that folder path into LocalFontPath as following. You can use following methods to get system folder of fonts or set font path to font folders.

  • Document.getLocalFontPath () - shows the system folder in which project will look for fonts.
  • Document.setLocalFontPath (String) - Setting font path to custom folder
// Set font folder path
String path = "/home/tilal/fonts/";

// Adding a single font directory
// com.aspose.pdf.Document.addLocalFontPath(path);

// Setting the user list for standard font directories
java.util.List<String> list = com.aspose.pdf.Document.getLocalFontPaths();
list.add(path);
com.aspose.pdf.Document.setLocalFontPaths(list);

// Other operations
// ...
// ...

We are sorry for the inconvenience caused.

Best Regards,

Thanks Tilal for your answer.

Currently, i’m working on Linux. I will try your solutions with installed packages require.

Could you tell me why the font were required to convert document ?
When I remove the call to “PdfDocument.convert()” there isn’t any issues, why ?
The conversion process need font to convert it ?

Regards,

Florian

Edit : after installed ttf-mscorefonts-installer and don’t modify application, it’s work fine !

Hi Florian,


Thanks for your feedback. As per my understanding your issue has been resolved after installation of Microsoft fonts.

In reference to fonts requirement, I have already stated that most of the PDF documents that we convert are created by people with fonts that are installed with Microsoft Windows or with Microsoft Office. So it is recommend to install Microsoft fonts on Non-Windows OSs.

Furthermore in reference to PDFA standards, all the fonts used in the PDF document are embedded in resultant PDFA. So all used fonts should be available on the host machine for PDFA conversion.

Best Regards,

Hi Hyunmook,

Thanks for your patience. Our product team has investigated the issue and would like to update you that problems with graphical
subsystem(PDFNEWNET-40678) has been solved with use of ConvertTransparencyAction parameter as following, but problems with font subsystem(PDFNEWNET-40688) still remain and these
problems are very serious.

Document pdfDocument = new Document(myDir+ “a.pdf”);
pdfDocument.Convert(myDir + “log.xml”, PdfFormat.PDF_A_1B,
ConvertErrorAction.Delete, ConvertTransparencyAction.Mask);

pdfDocument.Save(myDir + "a_pdfa.pdf");

The first problem is that input document has very specific font - “HYSMyeongJo-Medium”. This font is not embedded in source PDF document. PDF/A standard requires that this font must be embedded into document, but we can’t embed it cause this font is absent on our machines. It’s a clear question - what to embed? If this font is presented on host computers then the input document will be converted into PDF/A without problems.

But what to do if problem font is absent? This font is very specific and it is a difficult task to find a font which can substitute font “HYSMyeongJo-Medium” correctly. Adobe Acrobat substitutes this font with the font “AdobeMyungjoStd-Medium” and it is clear from font’s name that it is a private Adobe’s font and we can’t use it for our font substitution. We have implemented a new feature that gives a possibility to set and use custom font substitution for customers, if they have problems with absence of a font on destination machine. To set font substitution they can use code like this:

FontRepository.Substitutions.Add(new SimpleFontSubstitution("HYSMyeongJo-Medium", "MingLiU"));

And here question arises what font to use for substitution is transmitted on customer’s side.

But if you agree to use custom font substitution another problem also have place with substitution of font “HYSMyeongJo-Medium”. This font has a specific encoding - “KSC-EUC-H”. Aspose.Pdf can not support encodings like this properly. And this support will be appeared after fix for task PDFNEWNET-40448. When this fix can be? It’s a difficult question, cause this fix requires very serious remake of almost all encoding functionality which has more than 100K of code. So we can’t guarantee that fix for PDFNEWNET-40448 will be at 11.9 version. After investigation and implementation of some encoding functionality in versions 11.8-11.9 situation with ETA for PDFNEWNET-40448 will be more clear.

We suppose there are no another approaches to solve this problem except:

destination machine has font “HYSMyeongJo-Medium” or
set custom font substitution and use it after fix of PDFNEWNET-40448.

So we have questions here -

Are you agree to substitute fonts at your own rules? If you disagree with it then task has to be closed as known issue, because we can’t use Adobe’s font. And if you agree for fonts substitution then can you wait for this time or not?

Please confirm your understanding. We are sorry for the inconvenience caused.

Best Regards,