.net html pdf文件,Pdf API for .NET: HTML (Url) to PDF Converter Demo

This sample uses EO.Pdf for .NET to convert any Url to PDF file.

Use it in your Application

Sample code to convert Url to PDF (many advanced features not shown here):

//Code to convert an Url or HTML file to PDF. The following code writes output to a file. You can

//also write output to a Stream, a PdfPage, or a PdfDocument object

HtmlToPdf.ConvertUrl(urlOrHtmlFile, outputFileName);

'Code to convert an Url or HTML file to PDF. The following code writes output to a file. You can

'also write output to a Stream, a PdfPage, or a PdfDocument object

HtmlToPdf.ConvertUrl(urlOrHtmlFile, outputFileName)

In addition to convert it to a file, it can also convert it to any .NET Stream object. For example,

you can convert it to a MemoryStream object, then retrieve the raw bytes of the PDF file from the

MemoryStream and attach it to an email, all without creating any physical file at all.

There are many conversion options available. Detailed documentation and sample code about this feature

can be found in the download package.

53821a43e382e7ce19f3f14c9b6a22a9.gif

Try it Online

Enter any Url you wish to convert, then click "Convert" button to

convert it into a PDF file. You will be able to download the converted

PDF file afterwards. Note the Url must be accessible from our server.

http://www.google.com

eo_web.ashx?id=1C62BC22-BE43-4a46-BB13-E8A5AC6650E5&i=b592a15f-6d34-45f9-b398-727b4f95046b&s=1

Please enter the text in the image:

More samples and demos with source code can be found in the

download package.

Core Features

Convert any Url or HTML file to PDF.

Rendering any Url or HTML page the same as your browser does, but

output as PDF;

Zero External Dependency. Does not depend on any Web browser on your

system. Will always work regardless you install, uninstall or

update your browsers;

Built-in Javascript Engine. All Javascript code runs

exactly the same way as they would in a browser. You can also

turn Javascript off;

Automatic and Manual Paging. The converter can automatically

page the contents into multiple pages completely based on page

contents or "hard page break" styles such as "page-break-before"

and "page-break-after" in your HTML code;

Scale to Fit. Automatically scaling the HTML page to fit

in PDF paper size, or use a fixed scaling factor (or not scaling at all);

Selectable Text and clickable Links. The generated PDF file

is not a "screenshot" type image. All texts in your HTML file are

rendered as selectable text in PDF. All links in your HTML file

are preserved;

HTTP Post and Authentication. Need to post a page or authenticate

with the server? Just provide the data you wish to post or user name

and password needed to login the server;

Multiple output options. Output to a file? Output to a stream?

Output to Web client? Output as a download file? Choose one that fits

your need.

And much more. Try it out for free to see it in action!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值