Wrong format when saving to PDF

Hello 

I am using QtBinariesWindows WebKit for converting HTML to PDF

my HTML page contain several DIVs with class="row", with several InputText fields .

when I convert the URL with my data to PDF, instead of showing me the row with horizontal InputText, its show me the inputText verticaly

this is the form



and this is the output pdf


this is the code I use for saving the PDF:

//Initialize HTML to PDF converter

        HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();


        WebKitConverterSettings settings = new WebKitConverterSettings();


        //Set WebKit path

        settings.WebKitPath = Directory.GetCurrentDirectory() + @"\QtBinariesWindows\"; /*Directory.GetCurrentDirectory() +*/

        settings.SinglePageLayout = Syncfusion.Pdf.HtmlToPdf.SinglePageLayout.FitWidth;

        settings.Orientation = PdfPageOrientation.Landscape;



        //Assign WebKit settings to HTML converter

        htmlConverter.ConverterSettings = settings;


        Syncfusion.Pdf.Graphics.PdfLayoutResult layoutResult = null;


        //Convert URL to PDF

        PdfDocument document = htmlConverter.ConvertPartialHtml(UriHelper.Uri.ToString(), "printable", out layoutResult);




        string driverID = DriverFileModel.IDnumber;

        fileToSave = driverID + " " + "תיק נהג";

        if (File.Exists(Directory.GetCurrentDirectory() + @"\PDF\" + fileToSave + ".pdf"))

        {

            File.Delete(Directory.GetCurrentDirectory() + @"\PDF\" + fileToSave + ".pdf");

        }


        FileStream fileStream = new FileStream(Directory.GetCurrentDirectory() + @"\PDF\" + fileToSave + ".pdf", FileMode.CreateNew, FileAccess.ReadWrite);

        fileToSave = Directory.GetCurrentDirectory() + @"\PDF\" + fileToSave + ".pdf";

        //Save and close the PDF document

        document.Save(fileStream);

        document.Close(true);

        fileStream = null;



2 Replies

GK Gowthamraj Kumar Syncfusion Team August 23, 2021 12:59 PM UTC

Hi Yaron,

Thank you for contacting Syncfusion support.

We have checked the reported issue with WebKit rendering engine, the reported issue may occurs due to missing of OPENSSL assemblies. Our WebKit rendering engine required OPENSSL assemblies for accessing the resources from HTTPS URL. The bootstrap styles may referred from HTTPS URL, so kindly ensure the OPENSSL assemblies are added in the machine where the conversion takes place. Please refer below link for more information about OPENSSL.
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl  

Some advanced bootstrap styles are not supported in WebKit rendering engine, that issues are occurs from QtWebKit rendering engine itself. So kindly try the conversion with Blink rendering engine, Blink rendering engine does not have OPENSSL dependency. Please refer below link for more information about Blink rendering engine.
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/blink  

Regards,
Gowthamraj K



YG yaron guez August 23, 2021 06:38 PM UTC

thank you for the quick reply


Loader.
Up arrow icon