Public Function GetInvoice() As Pdf
Dim pdf As Pdf = New Pdf()
Dim xmlFile As String = path + "\\Xml\\Invoice.xml"
pdf.BindXML(xmlFile, Nothing)
Dim headerFooter As HeaderFooter = pdf.Sections(0).OddHeader
Dim logoImage As Image = CType(headerFooter.Paragraphs(0), Image)
logoImage.ImageInfo.File = path + "\\Images\\logo1.jpg"
logoImage.ImageScale = 0.74F
Dim Footer As HeaderFooter = pdf.Sections(0).OddFooter
Dim text As Aspose.Pdf.Text = CType(Footer.Paragraphs(0), Aspose.Pdf.Text)
Dim seg As Segment = text.Segments(0)
PutSearchString(pdf) ' to write a heading table
PutInvoice(pdf) ' to write the data table
Return pdf
End Function
Xml is as follows
<?xml version="1.0" encoding="utf-8" ?>
Page $p of $P
One Portals Way,Twin Points WA 98156
Phone: 1-206-555-1417 Fax: 1-206-555-5938
This code is working fine on my local machine. But once I move to the web server, it is not working. I could locate it is happening because of pdf.BindXML(xmlFile, Nothing) statement and throws a security error.
Could any one please transalate the above code so that it can work without the xml file. I have to give a demo to the client urgently. Helping hands are highly appreciated. Forgive me for asking too much but I'm very new to aspose.pdf
Thanks in advance.