Hello,
I am using Aspose.PDF version 11.2 to convert HTML to PDF. In my HTML files I have some images loading from a shared network path.
Images are loading properly inside the html file but they are not displayed inside PDF file. below is the code I am using:
Dim pLicence As Aspose.Pdf.License = New Aspose.Pdf.License
pLicence.SetLicense(“Aspose.Total.lic”)
Dim basePath As String = Path.GetDirectoryName(FilePath)
Dim htmloptions As New HtmlLoadOptions(basePath)
’ Load HTML file
Dim pdfDocument As New Document(FilePath, htmloptions)
pdfDocument.PageInfo.Width = 597.6
pdfDocument.PageInfo.Height = 842.4
'get page collection
Dim pageCollection As PageCollection = pdfDocument.Pages
'get particular page
For Each pdfPage As Page In pageCollection
pdfPage.SetPageSize(597.6, 842.4)
Next
'Optimize the pdf file in order to decrease it’s size
Dim optimization As Aspose.Pdf.Document.OptimizationOptions = New Aspose.Pdf.Document.OptimizationOptions()
optimization.LinkDuplcateStreams = True
optimization.RemoveUnusedObjects = True
optimization.RemoveUnusedStreams = True
optimization.CompressImages = True
pdfDocument.OptimizeResources(optimization)
’ Save HTML file
pdfDocument.Save(pdfFilePath, SaveFormat.Pdf)
How can I resolve the issue. I need a solution ASAP.
Thanks.