Help with HTML to PDF conversion with VB.net


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 14 of 14

Thread: Help with HTML to PDF conversion with VB.net

  1. #1
    Join Date
    Oct 2005
    Posts
    95

    Help with HTML to PDF conversion with VB.net

    Hi

    I need some help with converting a HTML document to PDF format . I have added a web browser control to my VB.net Application where I am generating the report in HTML format . I need to save that HTML format report to PDF file . I have got couple of third party software that does that .But my boss want me to create a button on the print preview and when user click on that button it will save the HTML format report as PDF file . I like to know how to add a button to the print previw and also how to save HTML format document as PDF file with code ( vb.net ) . The third party software does not work for my company as we will have to install that software in our client computer ( to save the HTML report as PDF file ) when we will delivar the project . Client does not like that . So please help me with the code to save the HTML report to PDF format or if there is any free component available .

    Thanks

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    If you are not going to do a third party software , you seriously need to know where you are treading with respect to PDF's , I would only say for now it is a whole project by itself, with all due respect tell ur boss he has to change the time lines of his project if he choses to make you do a HTML - PDF conversion tool,
    A lot of vendors sell them as products so I hope you understand how big an assignment it would be
    Sri

  3. #3
    Join Date
    Oct 2005
    Posts
    95

    Help with HTML to PDF conversion with VB.net

    Hi

    Thanks for the reply .Do you know any free component that will convert the HTML report to PDF format . I have got couple of third party software that does that but the problem is I will have to load those software in the client computer in order for convert HTML to PDF . Client does not want any extra software installed on their computers . I wonder if there is any free component to convert HTML to PDF which I can use in my VB.NET application

    Thanks

  4. #4
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    I know about ABCpdf which is to be used on the webserver so i am guessing this is a nice solution ? search for ABCPDF on google it is not very expensive and does the job neatly, There is a new .Net version for this component also
    Sri

  5. #5
    Join Date
    Aug 2007
    Posts
    1

    html to pdf

    kindly reply me how to convert html to pdf in vb.net code

    thanks

    jak

  6. #6
    Join Date
    Aug 2007
    Posts
    3

    Winnovative HTML to PDF Converter for .NET

    The best one for its price the HTML to PDF Converter Library for .NET 2.0 from http://www.dotnet-reporting.com or the HTML to PDF Converter from http://www.winnovative-software.com . You can convert a HTML string or a web page URL to PDF in only a few lines of code:

    PdfConverter pdfConverter = new PdfConverter();
    pdfConverter.LicenseKey = "P38cBx6AWW7b9c81TjEGxnrazP+J7rOjs+9omJ3TUycauK+cLWdrITM5T59hdW5r";
    // set the converter options
    pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
    pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
    pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
    pdfConverter.PdfDocumentOptions.ShowHeader = false;
    pdfConverter.PdfDocumentOptions.ShowFooter = false;

    pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = selectablePDF;

    // Performs the conversion and get the pdf document bytes that you can further
    // save to a file or send as a browser response
    byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);

    // send the PDF document as a response to the browser for download
    System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
    response.Clear();
    response.AddHeader("Content-Type", "binary/octet-stream");
    response.AddHeader("Content-Disposition",
    "attachment; filename=ConversionResult.pdf; size=" + pdfBytes.Length.ToString());
    response.Flush();
    response.BinaryWrite(pdfBytes);
    response.Flush();
    response.End();

  7. #7
    Join Date
    Aug 2007
    Posts
    3

    Winnovative HTML to PDF Converter for .NET

    Hi,

    The new version 3.2.3 of the Winnovative HTML to PDF converter library for .NET is now faster and has a lot of new features like CSS page breaks, keep together, password protection, embedded fonts.
    Here you can see all the new HTML to PDF converter features. If you liked the version 2.x you'll love 3.2.3.

    Regards,
    Florin

  8. #8
    Join Date
    Oct 2011
    Posts
    1

    HTML to PDF

    Hi,

    You can add a print button for preview, and save the HTML-document as a PDF file or show it to user with the code with the help of PDF Metamorphosis. Net. By adding this library in your application you do not need install anything to client computer. The code for this below. I think the result will suit you and your boss

    Code:
    	Dim p As New SautinSoft.PdfMetamorphosis()
    		p.PageStyle.PageSize.A3()
    		p.HtmlOptions.BaseUrl = Server.MapPath("")
    		Dim htmlString As String = "place HTML string here"
    		Dim pdfBytes() As Byte = p.HtmlToPdfConvertStringToByte(htmlString)
    
    		'show PDF
    		If pdfBytes IsNot Nothing Then
    			Response.Buffer = True
    			Response.Clear()
    			Response.ContentType = "application/PDF"
    			Response.BinaryWrite(pdfBytes)
    			Response.Flush()
    			Response.End()
    		End If

  9. #9
    Join Date
    Nov 2011
    Posts
    3
    Here is an easy to use Html to PDF tool.

  10. #10
    Join Date
    Dec 2011
    Posts
    1
    To convert HTML web files to PDF format, here HTML to PDF Converter works well on it.

  11. #11
    Join Date
    Nov 2011
    Location
    Newyork
    Posts
    8
    Try the classic PDF converter to convert your files instead of just falling in the coding and the complexities, you can convert nearly 500 formats with just a few clicks.

  12. #12
    Join Date
    Oct 2008
    Posts
    142

    html to pdf

    hi there,

    i found some saved google searches that might help:

    Code:
    html to pdf .net
    Code:
    html to pdf c#
    Code:
    html to pdf vb.net
    Code:
    html to pdf visual basic
    good luck,

    tonci korsano

  13. #13
    Join Date
    Nov 2011
    Posts
    3
    It might turn out to be an engaging project or a total waste of time as a third party software can do this easily. PDF creator is a virtual printer that allows you to convert any printable document to PDF. So, if you install it, all what you need to do is hit print button and choose the virtual printer. Try it.

  14. #14
    Join Date
    Apr 2013
    Posts
    1
    well .according to your problem,I find some page on google concernning codes for HTML-PDF conversion in VB.NET. samples are offered here ,It might help

Similar Threads

  1. Conversion of HTML report to PDF format
    By software_develo in forum .NET
    Replies: 6
    Last Post: 05-17-2013, 05:24 AM
  2. Convert HTML DOC to PDF
    By Humair in forum .NET
    Replies: 0
    Last Post: 04-23-2005, 08:27 AM
  3. What are the Advantages of VB.NET?
    By Sandhya in forum .NET
    Replies: 142
    Last Post: 10-01-2003, 01:00 AM
  4. From VB.net to C#
    By Thomas Eyde in forum .NET
    Replies: 195
    Last Post: 04-12-2002, 05:51 PM
  5. VB.NET: 3 points of view
    By David Kroll in forum .NET
    Replies: 33
    Last Post: 02-13-2001, 11:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center