We’re evaluating which HTML to PDF converter we’re going to use in a project and so far things are looking for Aspose. However, we’ve found two problem. The first one is size
The reason for this is that the fonts are much larger than what for example ABCPdf, Winnovative or Playwright adds to the PDF.
I’ve tested with the optimize settings found in this forum
var x = new Aspose.Pdf.License();
x.SetLicense(“Aspose.lic”);
HtmlLoadOptions options = new HtmlLoadOptions();
Document pdfDocument = new Document(“test.html”, options);
var optimizationOptions = new Aspose.Pdf.Optimization.OptimizationOptions();
optimizationOptions.RemoveUnusedObjects = true;
optimizationOptions.RemoveUnusedStreams = true;
optimizationOptions.AllowReusePageContent = true;
optimizationOptions.LinkDuplcateStreams = true;
optimizationOptions.UnembedFonts = true;
optimizationOptions.ImageCompressionOptions.CompressImages = true;
optimizationOptions.ImageCompressionOptions.ImageQuality = 100;
optimizationOptions.ImageCompressionOptions.ResizeImages = true;
pdfDocument.OptimizeResources(optimizationOptions);
pdfDocument.Optimize();
pdfDocument.Save($“aspose-optimize.pdf”);
Aspose file size 74kb:
image.png (5.9 KB)
Abcpdf file size 31kb
image.png (6.7 KB)
This is just one small example but holds of for larger documents as well.
Any ideas what can help?