Wrong html to pdf

Hello, i have a problem with "html to pdf", no apply my css file.
This is my code:


Aspose.Pdf.HtmlLoadOptions htmloptions = new Aspose.Pdf.HtmlLoadOptions(pathCSS);
htmloptions.PageInfo.Margin.Bottom = 10;
htmloptions.PageInfo.Margin.Top = 10;
htmloptions.PageInfo.Margin.Left = 20;

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(filehtml, htmloptions);
doc.Save(archivodestino);

Attachment css file , html file and pdf


Thank you

Hi there,

Thanks for your inquiry. I have tested the conversion as following and unable to notice the reported issue. Please double check you basepath for CSS file, it will resolve the problem.

// Create HtmlLoadOptions with base path
Aspose.Pdf.HtmlLoadOptions htmloptions = new Aspose.Pdf.HtmlLoadOptions("D:/Downloads/files/");

// Set page margins
htmloptions.PageInfo.Margin.Bottom = 10;
htmloptions.PageInfo.Margin.Top = 10;
htmloptions.PageInfo.Margin.Left = 20;

// Load HTML document with specified options
Aspose.Pdf.Document doc = new Aspose.Pdf.Document("D:/Downloads/files/documento.html", htmloptions);

// Save the PDF document
doc.Save("D:/Downloads/documento.pdf");

Please feel free to contact us for any further assistance.

Best Regards,

Hello,

Before, I used Aspose.Pdf 2015.03.05 and working good, now with 2016.06.02 not working,

Anyone idea?

Thanks again!

Hi, thanks!!


Please, put the file css into network folder, Im testing and into local folder work fine but in network folder not working.

Thank you again!

Hi there,

Thanks for your inquiry. I have tested your scenario with shared documents via network folder and noticed the regression issue, so I have logged an issue in our issue tracking system as PDFNET-41151 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

The issues you have found earlier (filed as PDFNET-41151) have been fixed in Aspose.Pdf for .NET 17.2.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.