Free Support Forum - aspose.com

Text Overlap in pdf

Hi,

I tried to convert docx file to pdf using Aspose. Following is the code I used to conversion. I experienced text overlapping in pdf file. Is there any mistake I have done with the code or is this a bug.

This is the code I used for conversion

Code:

Document doc = new Document(docxPath);
string xmlFile = “e:\Document.ConvertToPdf Out.xml”;
doc.Save(xmlFile, SaveFormat.AsposePdf);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(xmlFile, null);

pdf.IsImagesInXmlDeleteNeeded = true;
pdf.IsBookmarked = true;
pdf.Save(pdfFilePath);

I have attached resulted pdf file and used docx file with this. The titles have overlapped with title numbers.

Thanx

Hello Sameera,

Thanks for considering Aspose.

I have tested the scenario with conventional/Legacy method and I am able to notice the same problem. For the sake of correction, please try using the Direct-to-PDF save method of Aspose.Words. As per my observation, the output with Direct-to-PDF save method is correct. For your reference, I have also attached the resultant PDF document. Please take a look.

For more information on Direct-to-PDF save method of Aspose.Words, please visit the following link. How-to: Convert a Document to PDF

In case it does not resolve your problem or you have any further query, please feel free to contact.

We apologize for your inconvenience.

Hi,

I used that method earlier for conversion. But I need to docx file table of content to be appeared as bookmarks of pdf file. Is that possible with that method? (I don’t know much about Aspose and all the methods I used are failed for my requirement). If it is possible please let me know.

Thnx for your reply

Thanx,
Sameera

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. In this case you can use PdfOptions.HeadingsOutlineLevels property:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.saving.pdfoptions.headingsoutlinelevels.html

Hope this helps.

Best regards.

Hi,.
Thank you for your reply.
I will try and let you know does it worked for me.

thanx,
Sameera

Hi,



It worked for me for the table of contents.


But i have another requirement. when there is no specific table of contents page, I need the headings of docx file to be appeared as bookmarks on pdf. I created new thread with this problem. There are some attachments showing the problem faced by me.

If you can please give me a way to overcome the problem.
Link to new thread : http://www.aspose.com/community/forums/236334/headings-in-docx-appear-as-bookmarks-on-pdf/showthread.aspx#236334

Thanx,
Sameera

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I just answered your question here:

Best regards.