I am using the following code to add some text to
an existing pdf. The resulting pdf shows an error (“An error exists on this
page…”) when opened in adobe acrobat Pro 9.4.6. I have attached the input (“C.pdf”)
and the output (“C.pdf”). System info – windows 7 64bit, visual studio 2010.<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>
Dim strFilePath_MeetingPackage2 As String = "M:\temp\TestProgrammingFiles\B.pdf"
Dim strFilePath_MeetingPackage3 As String = "M:\temp\TestProgrammingFiles\C.pdf"
Dim mender As New PdfFileMend(strFilePath_MeetingPackage2, strFilePath_MeetingPackage3)
Dim TextHeader_Centre As New FormattedText("Agenda", System.Drawing.Color.Black, Aspose.Pdf.Facades.FontStyle.TimesRoman, EncodingType.Winansi, True, 10)
mender.IsWordWrap = True
mender.WrapMode = WordWrapMode.Default
mender.AddText(TextHeader_Centre, 1, 20, 770)
mender.Close()
I run into even more problems if I try to use “ScannedDoucment2.pdf” (attached) as the input. In this situation I get a missing object error (“Object reference not set to an instance of an object”) when the “mender.AddText(TextHeader_Centre, 1, 20, 770)” line is run.
Thanks