Convert PDF to DOCX in Java using Aspose.PDF - output is blank

Hi

We are using a trial version for our POC and noticed that upon import the ASPOSE.PDF libraries to our third-party system, the DOCX is created but with a blank page.

The same code I used independently in the windows environment and it works.

Our code as follows:

com.aspose.pdf.Document pdfdoc = new com.aspose.pdf.Document("/mnt/shared/Pega/Enfw/test.pdf");
pdfdoc.save("/mnt/shared/Pega/Enfw/test1.docx", com.aspose.pdf.SaveFormat.DocX);

Please advise

Thanks
Pathi

@ramanna,

Kindly share all details of the scenario, including source PDF and let us know which third party system you are using. We will investigate and share our findings with you.

InputPDF.pdf (2.1 KB)

Hi Imran - Thanks for your response.

Please find the attached PDF file for your reference. Our third-party system is Pega.
The code is as stated in my previous message.

Thanks & Regards,
Ramanna

@ramanna,

Pega is a software package to develop applications and have multiple products. We recommend you to please also contact with the Pega support and tell them about the prerequisite(.NET framework) of Aspose.PDF for .NET API. Kindly provide the specific information of the scenario like how we can replicate the same problem on our environment.

Hi Imran - Thanks for your advice.

How about Aspose.WORDS? Does it need .NET API as well?

Thanks,
Ramanna

@ramanna,

Please note, the prerequisite of all Aspose for Java APIs is JDK 1.6 or higher versions, and this also implies to Aspose.PDF and Aspose.Words for Java APIs. You are not using Aspose for .NET APIs, so please discard our previous reply about the prerequisite .NET framework. We are sorry for the inconvenience caused.

Noted. Then, what would be the reason for generating blank WORD document for the above code?

Appreciate your response.

@ramanna,

Your scenario works in the local environments and it is difficult to say anything about the third party environment variation. Please send us your blank output Word document.

test1.zip (152 Bytes)
Attached is the blank document in zip file.
Do you think it is due to licensing? Anyways we are in midst of finalizing the product.
Please help to check whether any of your clients’ system is integrated with Pega.

Thanks.

@ramanna,

Well, if the Aspose license is not being applied, then Aspose.Pdf API adds an evaluation watermark and process only 4 elements of each collection. There is no evaluation watermark in your output DOC file and also the author is not Aspose. When we convert a PDF to DOC with Aspose.Pdf API, it sets author of the document to Aspose.

Aspose for Java APIs only require JDK 1.6 or higher, which is known as the basic requirement of the development platform. Please take the confirmation from Pega about the support of JDK.

The JDK version of Pega is 1.7, so there shouldn’t be any problem. We also noticed ASPOSE.WORDS API also facing the similar issue, unable to convert WORD to PDF.

Could you help to check whether any of your clients facing issue when integrated with Pega?

@ramanna,

We could not find any old communication regarding the problem of Pega integration. Please coordinates with Pega support, and let us know if they share any technical details about the root cause of issues with Aspose.PDF and Aspose.Words for Java APIs.

FYI, Pega is not throwing any error upon executing of the statements. We are unable to raise any issue to Pega at this point in time. Are there any other methods we can use to replace the below so that we can achieve our expected result.

com.aspose.pdf.Document pdfdoc = new com.aspose.pdf.Document("/mnt/shared/Pega/Enfw/test.pdf");
pdfdoc.save("/mnt/shared/Pega/Enfw/test1.docx", com.aspose.pdf.SaveFormat.DocX)

I have regenerated the blank document once again for your perusal. Please check. Thanksstatement1.zip (164 Bytes)

@ramanna,

Which Aspose.Pdf for Java API version and JDK 1.7 update you are using? Kindly share all environmental detail of the Pega system, including product name, local operating system (name & version) and some handy information which could help us to replicate the problem in our environment. The latest version 17.12 of Aspose.Pdf for Java API adds Aspose in the output document properties. Snapshot: https://i.imgur.com/i1w42VR.png

ASPOSE.PDF forJAVA API Version : 17.12
JDK Version : 1.7.1_64
Pega Systems: 7.2.2
Linux: 3.10.0-514.21.2.el7.x86_64 #1 SMP Sun May 28 17:08:21 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

Please let me know if you need further information.

@ramanna,

We have logged an investigation under the ticket ID PDFJAVA-37430 to add the compatibility support of Pega system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Hi Imran - Thanks for your help.

We have new findings for your investigation.

Steps performed:

  1. In windows which are working code, we have created a jar file
  2. Copied the jar to our Pega Linux server
  3. Executed with Java -jar jarfile

Encountered the following error from ASPOSE libraries. Below is the screenshot for your reference:

Exception in thread “main” class com.aspose.pdf.internal.ms.System.z95: Cannot find any fonts installed on the system.
com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
com.aspose.pdf.internal.p127.z14.(Unknown Source)
com.aspose.pdf.internal.p126.z14.m1(Unknown Source)
com.aspose.pdf.internal.p127.z1.m42(Unknown Source)
com.aspose.pdf.internal.p127.z1.(Unknown Source)
com.aspose.pdf.internal.p126.z14.m1(Unknown Source)
com.aspose.pdf.internal.p41.z6.(Unknown Source)
com.aspose.pdf.internal.p84.z2.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
com.aspose.pdf.ApsUsingConverter.m2(Unknown Source)
com.aspose.pdf.z58.m1(Unknown Source)
com.aspose.pdf.ADocument.m1(Unknown Source)
com.aspose.pdf.Document.m1(Unknown Source)
com.aspose.pdf.ADocument.save(Unknown Source)
com.aspose.pdf.Document.save(Unknown Source)
PDFtoWord.main(PDFtoWord.java:19)
at com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p281.z11.m1(Unknown Source)
at com.aspose.pdf.internal.p127.z14.(Unknown Source)
at com.aspose.pdf.internal.p126.z14.m1(Unknown Source)
at com.aspose.pdf.internal.p127.z1.m42(Unknown Source)
at com.aspose.pdf.internal.p127.z1.(Unknown Source)
at com.aspose.pdf.internal.p126.z14.m1(Unknown Source)
at com.aspose.pdf.internal.p41.z6.(Unknown Source)
at com.aspose.pdf.internal.p84.z2.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m1(Unknown Source)
at com.aspose.pdf.ApsUsingConverter.m2(Unknown Source)
at com.aspose.pdf.z58.m1(Unknown Source)
at com.aspose.pdf.ADocument.m1(Unknown Source)
at com.aspose.pdf.Document.m1(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at PDFtoWord.main(PDFtoWord.java:19)

Thanks.

@ramanna,

You can specify the custom font directory which has the required font files, and then add this directory in the font folder list as follows:

[Java]

String path = "path/to/my/folder";
List<String> fontPaths = com.aspose.pdf.Document.getLocalFontPaths();
fontPaths.add(path);
com.aspose.pdf.Document.setLocalFontPaths(fontPaths);

We will install the fonts in Linux and try out.

On a separate note, we have installed the trial version to evaluate the product and our procurement manager is working with accounts to buy the Aspose.Total.

I believe the trial version one month period is going to end by this week. Can we have the temporary license till we get the licensed product?

Please advise. Thanks.