Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Is there any way to convert ASP.NET webpage to convert as a pdf with one button click with out using any dll
Posted
Comments
Sergey Alexandrovich Kryukov 30-Mar-15 20:57pm    
Strictly speaking, you cannot "convert" the page: it is something dynamic, and PDF is static, a kind of electronic paper. You can only represent one moment of the page life, at fixed page size, and so one. By the way, it makes very little sense.

How to do it "without any DLL"? What's the problem: learn both HTML and PDF format very well and write code. This is not something requiring expert advice, just a lot of work.

—SA

Ideally you'd really need to convince someone to buy a good pdf converter libary.

If not, there is a way.

On the server you could setup a printer queue that prints to a PDF file. There are printerdrivers out there that can do this.

You could than send the rendered HTML to that printer queue en return the document that comes out of that. You do have to look at you're CSS and posible provide print media queries to fix outlining.

And experiment with what printer driver to use. The results range from acceptable to horrible.

Also because an HTML document is a flow document en and a PDF document is a fixed document. You will get issues with line breaking. You'll need to adress this through HTML/CSS which wasn't build to do that.


Obviously there is another way and that is to hardcode the PDF yourself.
However this would take years of experience, which why you should by a dll from a company that has that experience
 
Share this answer
 
Why don't you want to use a dll? There are several libraries that can do this.
 
Share this answer
 
Comments
shiva2239 31-Mar-15 2:03am    
Because we do not have permissions in our organization for third party dlls

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900