Free Support Forum - aspose.com

Loose heading numbers- when converting doc to pdf

Hello,

I have a problem, when converting a word-document to a pdf. In the new words component (4.4.1.0) I loose the chapter numbers beside the heading. All the other formatting of the document is converted correctly.

Is there any new flag/option to set, when doing the conversion?

It works fine, when using an earlier version of the Aspose.words component (4.4.0.0)?

Thanks for your answers!

Best Regards
Thomas

Hello!

Thank you for asking this. It sounds like we made a regression. But I have to check it myself. Would you please attach the document reproducing this?

Thank you,

Hello,

I attached the original and the resulting document in an archive. Below the code I used to convert the document.


Pdf pdf = new Pdf();
Document doc = new Document(“AsposeTest.doc”);
doc.SaveOptions.PdfExportFormFieldsAsText = false;
MemoryStream memStream = new MemoryStream();

doc.Save(memStream, SaveFormat.AsposePdf);
memStream.Seek(0, SeekOrigin.Begin);

pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(memStream, null);
//pdf.BookMarkLevel = 1;
//pdf.IsBookmarked = true;
pdf.Save(“AsposeTest.pdf”);
Console.WriteLine(“Finished converting doc to pdf.”);


Thanks for your help!
Thomas


Hi Thomas.

I've found the cause of this problem. This appeared when we had added support of segment IDs in the intermediate XML. XML itself is correct but Aspose.Pdf doesn't render list labels in case when headings are bookmarked with "TOC field". I'll ask Aspose.Pdf team for cooperation and we'll fix this shortly.

Here is the comparision:

Now (4.4.1.0):


#$NP

ABSTRACT

Before (4.4.0.0):


#$NP
ABSTRACT

Regards,

Hi Thomas,

In Aspose Pdf side, it is not aware of this setting yet. I have logged it as PDFNET-3917. We will try to fix it ASAP.

Best regards.

Hans,
As a case we could combine two segment elements and avoid the empty segment at all. We can add ID to the real segment with heading text. I managed not to do this just because we can have several bookmarks started at one point. Or otherwise we would have to choose what bookmark should be populated directly to the real segment and what others to fictive segments, or make different logic for one bookmark and multiple bookmarks. It would be better to provide a fix on your side.
Regards,

Hi!

Thanks a lot for working on a solution of my problem! I’ll be happy to hear from you.

Best Regards
Thomas

Hi Thomas,

The problem has been resolved. Please try the attachment.

Best regards.

Thanks a lot - this fix works fine :slight_smile:

Best Regards
Thomas