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

Free Support Forum - aspose.com

Howto load a document- make changes and export to pdf?

hello everybody,

I am new to ASPOSE and a little bit confused with all the doc available here.

Here is what I would like to do:
I have a doc file already present in a directory
I want to add lines numbers to this file and then save the result to a new pdf file.

Here is the code I use but something must be wrong since I don’t get lines numbers in the pdf file

Public Function CreatePDFFromDoc(ByVal docFile As String, ByVal pdfFile As String) As String

Dim doc As New Aspose.Words.Document(docFile)

For Each sect As Aspose.Words.Section In doc.Sections
sect.PageSetup.LineNumberRestartMode = LineNumberRestartMode.Continuous
sect.PageSetup.LineNumberCountBy = 1
sect.PageSetup.LineStartingNumber = 1
doc.Save("tmp.xml", SaveFormat.AsposePdf)

Dim pdf As New Aspose.Pdf.Pdf
pdf.BindXML("tmp.xml", Nothing)
pdf.IsImagesInXmlDeleteNeeded = True

Return ""
Catch ex As Exception
Return ex.Message
End Try

End Function

rem: if I save to another word file, I get the line numbers!

Thank you for your help


I realize that line numbers, even if added in the word document, are not kept during the conversion to PDF. It’s a big issue for me since my client absolutely needs this feature!

What am I doing wrong???


Thanks for your request. Auto line numbering is not supported upon converting to PDF. This is the known issue #7241 in our defect database. I will notify you as soon as it is fixed.
Best regards.

Thank you for your quick response.
Do you have an idea when this feature will be available?
best regards


Thanks for your inquiry. Unfortunately, I cannot provide you any reliable estimate at the moment. Hopefully, this feature will be supported in Q2 2009, but I cannot promise anything.
Best regards.


Anything new about this new feature I really need?

thank you very much, best regards


Thanks for your inquiry. Unfortunately, “Auto Line Numbering” feature is still unavailable. You will be notified as soon as this feature is implemented.
Best regards.

Hi Alexey,

anything new about this?

best regards


Thanks for your inquiry. Unfortunately, this feature is still unsupported.
Best regards.

The issues you have found earlier (filed as 7241) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.