i want to remove blank pages with html to pdf Converter

Hello, after converting an HTML page to pdf there are some blank pages in there. is there a way i can remove the blank pages. Below is a sample of my code.


            var finalDoc = new PdfDocument();

            finalDoc.PageSettings.Size = PdfPageSize.A4;

            System.IO.Stream[] streams = { stream1, stream2, stream3, stream4, stream5 };

            PdfDocumentBase.Merge(finalDoc, streams);

         finalDoc.Save(reportStream);

          finalDoc.Close(true);


Please help. Thanks


1 Reply

GK Gowthamraj Kumar Syncfusion Team February 28, 2022 11:41 AM UTC

Hi sam 
 
Our HTML converter may generate blank PDFs while converting HTTPS sites to PDF. For converting HTTPS sites to PDF, the WebKit rendering engine requires OPENSSL libraries. So, please make sure the OPENSSL assemblies are available in the machine where the conversion takes place. Please refer to the below links for more details,  
 
Prerequisites - https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl   
Troubleshooting - https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf#troubleshooting       
 
However, the below mentioned assemblies can be placed in the Windows system folder (for 64-bit machine, it should be place in $SystemDrive\Windows\SysWOW64 and for 32-bit machine, it should be place in $SystemDrive\Windows\System32),
 
 
  • libeay32.dll
  • libssl32.dll
  • ssleay32.dll

We request you to share the simple sample with input HTML webpage, output documents, complete code snippet, server environmental details (OS, Bit version, platforms, culture settings), replication sample with steps to check the issue on our end. So, that it will be helpful for us to analyze and assist you further on this.     

If you want to remove the blank page from PDF document, we have analyzed your requirement. The “PdfDocument” is used to create the PDF document only and we cannot able to remove pages from it. However, we can remove the blank page if the PDF document contains images and text. If the document contains shapes such as rectangle, square, etc., removing the blank page will not be possible. Please find the below sample in ASP.NET Core platform which illustrates the same from below,    
Kindly try the above sample in your end and let us know the result.    

Regards, 
Gowthamraj K 


Loader.
Up arrow icon