Print Page | Close Window

HTML to PDF

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2367
Printed Date: 29 Apr 25 at 4:50PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: HTML to PDF
Posted By: waynefulcher
Subject: HTML to PDF
Date Posted: 09 Aug 12 at 11:01PM
Can anyone tell me if I have a program that reads the text from an HTML file, If there is any way at all to use QuickPDF (I am on 8.16) to convert the HTML to a PDF... heres the catch. I want to specify a "pagesize" like "letter" then I want the function to automatically create enough pages in the PDF to render all of the HTML in porportion. I see the DrawHTML() method but if the rendered HTML is so long it takes 10 pages to draw it all then how do I handle that?
 
If there is no simple one call method to do this is there some work-a-round?
 
Thanks Wayne
 



Replies:
Posted By: AndrewC
Date Posted: 20 Aug 12 at 12:44PM
Wayne,

This code might be useful

            QP.NewDocument();
            QP.SetOrigin(1);

            string s = File.ReadAllText("input.html");

            QP.DrawBox(10, 10, 300, 500, 0);
            string overflow = QP.DrawHTMLTextBox(10, 10, 300, 500, s);

            while (overflow != "")
            {
                QP.NewPage();
                QP.DrawBox(10, 10, 300, 500, 0);
                overflow = QP.DrawHTMLTextBox(10, 10, 300, 500, overflow);
            }

            QP.SaveToFile("out.pdf");




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk