Free Support Forum - aspose.com

Handle blank line


#1

We have a functionality to replace the fields (<<Filed>>) dynamically from a word document & then convert it to a pdf document. Previously we used Aspose pdf version 3.9.0.0 & recently we upgraded it to 18.9.0.0. After upgrading the Aspose version we had to modify the codes are as follows:

Please check attached Image1.jpeg

In Aspose 3.9.0.0 version we used “Pdf()” class to generate Pdf object but in new Aspose 18.9.0.0 version we didn’t find any such kind of “Pdf()” class.

So after changing the above code for new version of Aspose , we found that in below Doc file, if «AAddressLine2» is replaced by a blank string then there is a blank line appearing between «AAddressLine2» & «ACity», «AStateAbbr» «AZipCode» in generated pdf where as in old version of Aspose with the same criteria blank line is not appearing:

Please check attached Image2.jpeg

Here is the pdf generated with New Aspose pdf version 18.9.0.0:

Please check attached Image3.jpeg

Here is the pdf generated with Old Aspose pdf version 3.9.0.0 :

Please check attached Image4.jpeg

Need help to figure out the alternative of Pdf() class in new version of Aspose to Aspose_5-16.zip (333.8 KB)
in generated pdf. Thanks!


#2

@vrushalidixit

You can remove the un-merged mail merge fields during mail merge process. Please refer to the following article.
How to Remove Unmerged Fields, Empty Paragraphs and Unmerged Regions

If you still face problem, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.