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
Try
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
Next
doc.Save("tmp.xml", SaveFormat.AsposePdf)
Dim pdf As New Aspose.Pdf.Pdf
pdf.BindXML("tmp.xml", Nothing)
pdf.IsImagesInXmlDeleteNeeded = True
pdf.Save(pdfFile)
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
Yvan