PDF to PDF/A format

Hi Please let me know whether there is any update on PDF to PDF/A format convertion.

Thanks

Hi Sherry,


Thanks for your inquiry. With Aspose.Pdf for Java, you can easily make a normal PDF comply with the PDF-A standard:
http://www.aspose.com/docs/display/pdfjava/Convert+PDF+File+to+PDF-A

As your query is more related to Aspose.Pdf, I am moving this thread to Aspose.Pdf forum where you’ll be guided appropriately.

Best regards,

Hi Sherry,


Adding more to Awai’s comments, we have the feature to convert PDF files to PDF/A format but recent release versions of Aspose.Pdf for Java have encountered some issues related to this feature. For the sake of correction, we already have logged this problem
as PDFNEWJAVA-33606 in our issue tracking system. We are looking into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

Thank you very much.

I am getting below error when i try to convert a pdf to PdfFormat.PDF_A_1B. Is this a known issue??

class com.aspose.ms.System.aw: Cannot access a disposed object.
Object name: 'MemoryStream'.
com.aspose.ms.System.d.m.c(Unknown Source)
com.aspose.ms.System.d.m.getLength(Unknown Source)
com.aspose.ms.a.b.e.a.available(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)

Hi Sherry,


Thanks for your feedback. I am afraid we are not getting any error but output document is not PDFA_1b compliant, so we had logged above mentioned issue for resolution.

Can you please share your sample document and code here? So we will test the scenario at our end and will provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Here is the sample code. I read the PDF file to a byte[] and convert to a PDF/A. You can try any pdf with around 750 KB of size.

public static byte[] convertPDFToPdfa (byte[] inputByteArray) throws Exception {
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
com.aspose.pdf.Document doc = new com.aspose.pdf.Document(new ByteArrayInputStream(inputByteArray));
doc.convert(System.out, com.aspose.pdf.PdfFormat.PDF_A_1B, ConvertErrorAction.None);
doc.save("C:\\download\\sample.pdf");
return byteStream.toByteArray();
}

Hi Sherry,


The recent release of Aspose.Pdf for Java 4.4.0 has issues while converting PDF files to PDF/A_1b format. During my testing, I have also observed cannot access a disposed object problem. We already have logged this problem in our issue tracking system as PDFNEWJAVA-33606 and our development team has made some significant progress towards its resolution. We hope to get this issue resolved by next release of Aspose.Pdf for Java 4.5.0. Please be patient and wait for new release.

We apologize for this inconvenience.

Any idea when we can expect the newer release having this issue resolved?

Hi Sherry,

Thanks for your inquiry. We are glad to inform you that above reported issue has been fixed and it is included in 4.5.0 as stated above.Hopefully Aspose.Pdf for Java 4.5.0 will be published in start of coming week. However we will update you via this forum thread as soon as it is published.

Thanks for your patience and cooperation.

Best Regards,

Hi Sherry,


Thanks for your patience.

I am pleased to share that Aspose.Pdf for Java 4.5.0 has been published and the problem reported earlier (Cannot access a disposed object.) is resolved in latest release. However there are some issues when validating the resultant PDF/A documents with Adobe Acrobat Pre-Flight. The development team has been intimated and they are working on fixing this problem. As soon as we have made some further progress towards its resolution, we would be more than happy to update you with the status of correction.

We are really sorry for this inconvenience.

Thank you very much. This new release worked for us.

I have two questions

1) Can doc.convert() method first parameter accept the general Logger like apache logger?

2) what is the difference between below two statements having the third parameter.

doc.convert(System.out, com.aspose.pdf.PdfFormat.PDF_A_1B, ConvertErrorAction.None);
and doc.convert(System.out, com.aspose.pdf.PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

For me ConvertErrorAction.None didn't worked at all and ConvertErrorAction.Delete worked.

sherry.katz:
1) Can doc.convert() method first parameter accept the general Logger like apache logger?
Hi Sherry,

Thanks for sharing the feedback.

The Convert(…) method either accepts String or OutputStream object as an argument and as per your requirement, you may consider saving the output in OutputStream and then save it to apache logger.

sherry.katz:
2) what is the difference between below two statements having the third parameter.

doc.convert(System.out, com.aspose.pdf.PdfFormat.PDF_A_1B, ConvertErrorAction.None);
and doc.convert(System.out, com.aspose.pdf.PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);

For me ConvertErrorAction.None didn't worked at all and ConvertErrorAction.Delete worked.

The third parameter specifies to convert the document and save errors into specified Stream/String. The action value indicates the action for objects which cannot be converted (either delete the objects which cannot be converted or take no action against objects which cannot be converted).

In the event of any further query, please feel free to contact.

Thank you very much.


Hi,


The convert works fine in my local windows box, but when deployed to different server on unix box. I am getting below error.


0000002a SystemErr R class com.aspose.ms.System.e: Key cannot be null

Parameter name: key
com.aspose.ms.System.a.h.get_Item(Unknown Source)

com.aspose.pdf.a.c.e.b.f$a.a(Unknown Source)

com.aspose.pdf.a.f.a.a(Unknown Source)
com.aspose.pdf.a.j.a.b.a(Unknown
Source)
com.aspose.pdf.a.j.a.b.i(Unknown Source)

com.aspose.pdf.a.j.a.b.a(Unknown Source)

com.aspose.pdf.ADocument.convert(Unknown Source)

com.aspose.pdf.Document.convert(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)

Please advise.

Thanks

Hi Sherry,


We are sorry for the inconveneince caused. Please set local font path on unix as following before conversion and share the results. Hopefully it will fix the issue.

com.aspose.pdf.Document.setLocalFontPath(path);

Please feel free to contact us for any further assistance.

Best Regards,

I tired by pointing to a local folder.


Now on windows it was failing. How do i get to fonts path?
[1/27/14 15:15:04:713 EST] 00000019 SystemErr R java.lang.NullPointerException
[1/27/14 15:15:04:713 EST] 00000019 SystemErr R at com.aspose.g.h.a(Unknown Source)
[1/27/14 15:15:04:713 EST] 00000019 SystemErr R at com.aspose.pdf.ADocument.preSave(Unknown Source)
[1/27/14 15:15:04:713 EST] 00000019 SystemErr R at com.aspose.pdf.ADocument.saveInternal(Unknown Source)
[1/27/14 15:15:04:714 EST] 00000019 SystemErr R at com.aspose.pdf.Document.saveInternal(Unknown Source)
[1/27/14 15:15:04:714 EST] 00000019 SystemErr R at com.aspose.pdf.ADocument.save(Unknown Source)
[1/27/14 15:15:04:714 EST] 00000019 SystemErr R at com.aspose.pdf.Document.save(Unknown Source)

Thanks

Hi Sherry,


Thanks for sharing the feedback.

Please note that we recently have published a hotfix for Aspose.Pdf for Java 4.5.1 which supports the feature to set font path for more than one fonts. Please try using the following code snippet where you can specify more than once font path (i.e. Linux, Windows etc).

[Java]

//adding a new font path<o:p></o:p>

String path = "c:\\fonts\\";

com.aspose.pdf.Document.addLocalFontPath(path);

//geting the list for standard font directories in different OS

java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();

//seting the user list for standard font directories

list.add("c:\\fonts2\\");

list.add("c:\\fonts3\\");

com.aspose.pdf.Document.setLocalFontPaths(list);

//Restoring list for standard font directories by default.

com.aspose.pdf.Document.restoreLocalFontPath();

Now, I am getting below error.

[1/30/14 17:22:42:895 EST] 0000002f SystemErr R java.lang.UnsupportedOperationException
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.c.e.c.c.(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.f.a.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.c.e.c.aa.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.c.e.c.a.a.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at aspose.pdf.html.HtmlWeb.setFont(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.c.e.d.d.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.j.a.b.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.j.a.b.i(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.a.j.a.b.a(Unknown Source)
[1/30/14 17:22:42:895 EST] 0000002f SystemErr R at com.aspose.pdf.ADocument.convert(Unknown Source)
[1/30/14 17:22:42:896 EST] 0000002f SystemErr R at com.aspose.pdf.Document.convert(Unknown Source)
[1/30/14 17:22:42:896 EST] 0000002f SystemErr R at com.aspose.pdf.ADocument.convertInternal(Unknown Source)
[1/30/14 17:22:42:896 EST] 0000002f SystemErr R at com.aspose.pdf.Document.convertInternal(Unknown Source)
[1/30/14 17:22:42:896 EST] 0000002f SystemErr R at com.aspose.pdf.ADocument.convert(Unknown Source)
[1/30/14 17:22:42:896 EST] 0000002f SystemErr R at com.aspose.pdf.Document.convert(Unknown Source)

Hi Sherry,


During my testing with above shared code snippet over Windows 7 (x64), I am unable to notice any problem. Can you please share some details regarding your working environment i.e. Operating System version, JDK version etc. We are really sorry for this inconvenience.

We have this issue on operating system AIX, 6.1 version. JRE 1.6