Issue with converting Word Textbox to PDF

Hi,


We recently purchased Aspose.Total for Java, which includes Aspose.Words for Java. We are trying to convert a DOCX document to PDF and bumped into some issue. Here is our scenario:

- The source DOCX document contains some Textboxes using Microsoft DrawingML plus the fallback VML, i…e, mc:AlternateContent, <mc:Choice Requires=“wps”>, and mc:Fallback.
- Such Textboxes contains some placeholder, which is replaced dynamically based on user’s input using the ‘Find and Replace’ feature supported by Range concept. The DOCX document after placeholder replacement shows the correct result when it is saved.
- However, if we convert the DOCX document after placeholder replace to PDF, the output still contains the placeholder instead of the replaced value in such Textboxes.

The following is the sample code we used and I am also attaching the test DOCX file and the result DOCX file and PDF file.

Document doc = new Document(“TestPlaceholderReplacementInTextbox.docx”);
doc.getRange().replace("${PLACEHOLDER}", “Aspose”, true, false);
doc.save(“TestAfterReplacement.docx”, SaveFormat.DOCX);

PdfSaveOptions options = new PdfSaveOptions();
options.setSaveFormat(SaveFormat.PDF);
options.setTextCompression(PdfTextCompression.NONE);
doc.save(“TestAfterReplacement.pdf”, options);

Our further investigation into the result DOCX file shows the following XML fragment in the attached XML file (part of document.xml). As you can see, the text in mc:Choice element is replaced properly (line 47), but the text in mc:Fallback element is not replaced (line 72). So it seems PDF conversion is taking the text from mc:Fallback element.

Could you help try this and let us know if this is a defect or if there is a workaround?

Appreciate your help!



I raised a technical issue in the forum. Could you get the support team to take a look? https://forum.aspose.com/t/47497

Hi Laurie,


Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11322. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi Laurie,

Your post has been replied. Please follow that post for further updated.

Best Regards,

Hi Awais,


Thanks for your reply!

This issue is affecting our 1Q2015 release urgently. Could you let us know your estimate of time required to fix the issue?

Hi Laurie,


Thanks for your inquiry. Unfortunately, your issue is not resolved yet. We have asked the ETA of this issue from our development team and will update you as soon as any estimates are available. We apologize for your inconvenience.

Best regards,

Hi Awais - I want to re-emphasize that this is a very basic requirement and affects a fundamental component of the application design. Please have an update shared at the earliest.

This is a surprising and upsetting issue that is impacting the application which in turn will impact the organization as well. I again request your immediate follow up with the Aspose Dev team.

Hi Awais / Dev Team - We need an update please about when the code will be fixed. Every hour of delay is resulting in loss of Development time for our team and hurting our deliverables.

Please help at the earliest.


Hi Laurie,

Thanks for your inquiry. In the meantime while we are waiting to hear from Aspose.Words development team, you can use the following code as a workaround:
Document doc = new Document(getMyDir() + "TestPlaceholderReplacementInTextbox.docx");
doc.getRange().replace("${PLACEHOLDER}", "Aspose", true, false);
doc.save(getMyDir() + "TestAfterReplacement.docx", SaveFormat.DOCX);

PdfSaveOptions options = new PdfSaveOptions();
options.setSaveFormat(SaveFormat.PDF);
options.setTextCompression(PdfTextCompression.NONE);
options.setDmlRenderingMode(DmlRenderingMode.DRAWING_ML);
doc.save(getMyDir() + “TestAfterReplacement.pdf”, options);

I hope, this helps.

Best regards,

Hi Laurie,


Regarding WORDSNET-11322, our development team has planned to include the fix to this issue in 15.2.0 - Feb 2015 release of Aspose.Words. If everything goes by plan, we are very hopeful to include the fix to your issue in Aspose.Words’ Feb 2015 release. We will inform you via this thread as soon as a release containing the fix to your issue is published.

Best regards,

Thanks, Awais!


We tried the workaround and it seems working. So we will use that workaround until we get the official fix in the Feb 2015 release, which we are looking forward to.

The issues you have found earlier (filed as WORDSNET-11322) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.