English | 日本
JAVA HTML to PDF Image 1
Shopping Cart Contact Us Java PDF

Get familiar with converting HTML to PDF in a VB.NET project with a few lines of code


It is not always easy to convert web pages or HTML files to PDF, especially when the quality of conversion and customization are important. An appropriate HTML to PDF .NET converter needs an SDK and library support. It is had to find a library or an API, which has good error handling, is customizable and scalable.

BCL easyPDF SDK is the best solution to create PDF files from HTML in a .NET environment. You will appreciate the simplicity, speed, and the quality of conversion. As a first step towards building an HTML to PDF application in .NET, install our easyPDF SDK. With a few lines of Visual Basic, developers can begin creating power HTML to PDF .NET converters.

Module TestPrinter
  Sub Main(Args As String())
    If Args.Length <> 2 Then
      Return
    End If

      Dim inputFileName As String = Args(0)
      Dim outputFileName As String = Args(1)
      Dim printer As New Printer()
    Try
         Dim printjob As PrintJob = printer.PrintJob
         printjob.PrintOut(inputFileName, outputFileName)
      Catch ex As PrinterException
         System.Console.WriteLine(ex.Message)
      Finally
         printer.Dispose()
      End Try
   End Sub
End Module

This SDK provides users with excellent quality of HTML to PDF conversion in VB.NET and we support a wide range of other programming languages.

https://www.pdfonline.com PDF file. Basic HTML to PDF .NET conversion with easyPDF SDK
HTML – input file (bcltechnologies.com/financial/data-mining.htm) PDF created from HTML .NET by easyPDF SDK Action Center

In a matter of minutes, you can convert any webpage (URL) or HTML file to a PDF document in .NET environment. The SDK also supports various settings, like additional security, margins, watermarks, font replacement, hyperlink preservation, page format settings and smart shrinking.


How to build HTML to PDF .NET application with multiple settings

To code your own HTML to PDF .NET converter with features such as margin settings, font replacements, page width, hyperlinks preservation and making it grayscale:

  1. Download and install free easyPDF SDK trial which comes with many useful PDF APIs for programming in .NET;
  2. Copy and paste the following lines of code to your application:
Dim inputFileName As String = Args(0)
Dim outputFileName As String = Args(1)
Dim printer As New Printer()
Try
         Dim printjob As IEPrintJob = printer.IEPrintJob
         Dim printerSettings As PrinterSetting = printer.PrinterSetting
         printerSettings.LayoutPaperSize = CInt(prnPaperSize.PRN_PAPER_A4)
         printerSettings.LayoutPaperOrientation = prnPaperOrientation.PRN_PAPER_ORIENT_PORTRAIT
         printerSettings.LayoutGraphicResolution = 300
         printerSettings.LayoutScaling = 100
         printerSettings.LayoutPrintColorType = prnPrintColorType.PRN_PRINT_COLOR_GRAYSCALE
         printerSettings.Save()
         Dim pdfSettings As PDFSetting = printjob.PDFSetting
         pdfSettings.FontEmbedding = prnFontEmbedding.PRN_FONT_EMBED_SUBSET
         pdfSettings.FontEmbedAsType0 = True
         Dim ieSettings As IESetting = printjob.IESetting
         ieSettings.Header = "&w&bPage &p of &P"
         ieSettings.Footer = "&u&b&d"
         ieSettings.MarginLeft = 0.0138888888888889
         ieSettings.MarginRight = 0.0138888888888889
         ieSettings.MarginTop = 0.0138888888888889
         ieSettings.MarginBottom = 0.0138888888888889
         ieSettings.PrintBGColor = True
         ieSettings.ShrinkToFit = True
         ieSettings.DisableScriptDebugger = False
         ieSettings.DisplayErrorDialogOnEveryError = False
         ieSettings.Save()
         printjob.PrintOut(inputFileName, outputFileName)
Finally
         printer.Dispose()
End Try 

The following code will add metadata settings to your HTML to PDF .NET converter:

…
pdfSettings.MetaData = True
         pdfSettings.MetaDataTitle = "title"
         pdfSettings.MetaDataAuthor = "author"
         pdfSettings.MetaDataSubject = "subject"
         pdfSettings.MetaDataKeywords = "keyword"
         pdfSettings.MetaDataCreator = "creator"
…

Powerful error handling mechanism could be added to your HTML to PDF .NET application with the following code:

…
Catch ex As PrinterException
         System.Console.WriteLine(ex.Message)
…
HTML file. Converting  to PDF .NET with multiple settings PDF file. HTML to PDF .NET conversion with easyPDF SDK
HTML – input file (bclresearch.com/Home) PDF created from HTML .NET with the code

Build professional HTML to PDF .NET applications with no coding

BCL easyPDF SDK provides a unique combination of properties and features with a user-friendly visual interface. This allows developers to build powerful conversion applications in .NET without any coding. Developing such an application has never been easier, now anyone can create enterprise-level HTML to PDF .NET converter applications with customized settings. Simply select the settings, generate an executable file, or generate the code with the press of a button.

Create HTML to PDF .NET app with multiple setting of conversion simple

Useful PDF Features for HTML to PDF .NET Programming

Our SDK offers a high-level .NET API for converting a variety of file formats to PDF, modifying existing PDF files, converting PDF documents to multiple image formats, and also populating PDF form fields. Our commercially supported toolkit is extremely easy to use in any .NET application working with PDF files.

BCL easyPDF SDK comes with robust error handling to help you merge, modify and convert HTML to PDF and many other formats. Threads are monitored for time-outs to make sure that they do not stop an application’s operation. Each thread in BCL easyPDF SDK is isolated from other threads and does not affect their operation.

Different PrintJob types are optimized for best rendering result for HTML to PDF conversion. PDF looks the same as the page in a web browser. HTML to PDF API supports PDF/A & PDF/X standards for long term archiving of electronic documents or exchange of print-ready PDF files in printing/advertising industries. It can automatically handle any exception or error message that may occur in converting HTML and Office documents to PDF.

SDK's speed and reliability are tested in our free PDF conversion service which processes thousands of PDF conversions per day and runs 24/7 with no human operator.

Many enterprise software developers in the world currently use and leverage the multitude of features supported by easyPDF SDK such as Image compression, Metadata, Font Embedding & Subsetting, Digital Signature & Stamping, Watermark, PDF Security, PDF Viewer setting.

Join them now by downloading HTML to PDF .NET free SDK trial!


HTML to PDF .NET SDK references

easyPDF SDK includes the following Libraries and APIs with imaginary features:

  • PDF Printer API supports converting multiple format documents to PDF;
  • PDF Processor API does Merging, Splitting, Rotating, Deleting, Extracting and Optimizing of PDF files;
  • PDF Converter API responds for Rasterizing PDF into BMP, GIF, JPEG, PNG, and TIFF image formats;
  • PDF Document API extracts, inserts, and updates data in PDF Forms with.

easyPDF SDK team provides professional support and assistance in the SDK integration with your desktop or server .NET application. Try it now!


Frequently Asked Questions

Read more


Why software developers from different countries and industries like our HTML to PDF .NET converter?
 

 We process approximately 5,000 - 10,000 PDF’s a month and have no issues so far everything has been working out great... 




BCL provides US based technical support to assist any customer with customization and HTML to PDF .NET converter integration with any enterprise and server applications. Contact us any time you need to get professional consultation.

Become our client now, convert HTML to PDF in .NET with the best quality and the professional assistance! Download free HTML to PDF .NET SDK trial now!

If you are looking for another solution, feel free to check our PDF Creator API, Desktop Solutions, and PDF Online Converters




 
© 1993 - , BCL Technologies.
All other trademarks are the property of their respective owners.