Missing Numbers on headings

Hello,
I’m using aspose.word 6.2.0.0 and aspose.pdf 4.0.0.0 to create a pdf from a docx using the code as follows:

MemoryStream pdfStream = new MemoryStream();
doc.SaveOptions.PdfExportImagesFolder = tmpDirName;
doc.Save(filename, SaveFormat.AsposePdf);
Aspose.Pdf.Pdf pdfDoc = new Pdf();
pdfDoc.BindXML(filename, null);
pdfDoc.Security = new Security();
pdfDoc.Security.IsDefaultAllAllowed = false;
pdfDoc.Security.IsPrintingAllowed = true;
pdfDoc.Save(pdfStream);

Later I send the pdfStream to the browser.
The pdf is created, but I’m missing the Numbering of the Headings (e.g. Artikel 1 or 1.1). The Problem seems to be very simular to:
https://forum.aspose.com/t/115649
The issue contains as Solution the Aspose.Pdf DLL (Version 3.6.1.2). But this DLL does not work for me: I get a “Unknown attribute in Heading element. The attribute Name is Label”
I would prefer a solution based on the actual aspose.word 6.2.0.0 and aspose.pdf 4.0.0.0 DLLs
Best Regards,
Burkhard

Hi

Thanks for your inquiry. It seems this is a problem in Aspose.Pdf. Aspose.Words outputs lables into an intermediate XML correctly. See the following example.

<Heading Level="2" LabelFontName="Arial" Label="Artikel 1" IsLabelBold="true" LabelAlignment="Right" LabelWidth="11.35" MarginLeft="39.7" MarginTop="11.4" IsSpaced="true" IsKeptWithNext="true" LineSpacing="2.4" ID="paraId_1">
	<TabStops>
		<TabStop Position="39.7" />
	</TabStops>
	<Segment ID="_Toc212274980" />
	<Segment FontName="Arial" IsTrueTypeFontBold="true" FontSize="9">Zustandekommen des </Segment>
	<Segment FontName="Arial" IsTrueTypeFontBold="true" FontSize="9">Vertrages</Segment>
</Heading>

So, you should contact with Aspose.Pdf team regarding this issue.
I also tried to convert your document to PDF using new method provided by Aspose.Words and output PDF looks perfect. So, maybe you should try using the latest version of Aspose.Words (6.3.0) and SaveToPdf method.
You can download the latest version of Aspose.Words from here:
https://releases.aspose.com/words/net
Please see the following link to learn more about differences between old and new method of PDF conversion.
https://docs.aspose.com/words/net/convert-a-document-to-pdf/
Here is code you can use to convert document to PDF:

// Open HTML Document Document doc = new Document("in.docx");
// Save PDF document
doc.SaveToPdf("out.pdf");

Best regards.