We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

When generating the PDF, the numbering of the headings does not match

good day,

I generated a DOCX file using ASPOSE. When I turn it into a PDF, the numbering of the headings does not fit.
If I open the file in MS Word then everything is fine. Could you advise me what is wrong.


@benestom sorry I can’t replicate your problem, I’m using the latest version (v23.2.0) of Aspose.Words package and the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);


builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading1;
builder.Writeln("Item 1");
builder.Writeln("Item 2");


builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
builder.Writeln("Item 2.1");
builder.Writeln("Item 2.2");


builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading3;
builder.Writeln("Item 2.2.1");
builder.Writeln("Item 2.2.2");


builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
builder.Writeln("Item 2.3");


builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading1;
builder.Writeln("Item 3");

doc.Save("C:\\Temp\\output.pdf", SaveFormat.Pdf);

output.zip (32.6 KB)

Ithanks for the reply, but this is a specific problem. I also have the latest version (v23.2.0) of Aspose.Words.
Normally everything is fine, but it doesn’t fit with a particular document. Please look at that document on page 7 after generating the PDF.

Thank you in advance0TSP612_02.docx (5.2 MB)

PDF_Word_diference.jpg (55.1 KB)

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25064

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.