-
Dec 6th, 2017, 10:50 PM
#1
Thread Starter
Member
Best way to save form to PDF
Hey Dears,
what is the best way to save form to pdf without using external links like isharp or others?
-
Dec 6th, 2017, 11:01 PM
#2
Re: Best way to save form to PDF
There isn't one. There's nothing specific to the PDF file format built into the .NET Framework. You'd have to understand the PDF specification and actually write the appropriate data to a file through a FileStream. That would be tedious for a specific case and really time-consuming for the general case. That's why components like iTextSharp exist. They have done all that tedious and time-consuming work already and wrapped it up into one or more easy-to-use types.
-
Dec 7th, 2017, 08:29 AM
#3
Re: Best way to save form to PDF
On my system I have the option of using "Microsoft Print to PDF" in my printer selection. I don't know if that is provided by the Operating System, or came as part of installing some other Microsoft application. I don't think it is the most efficient, as it creates a much larger PDF file than if I use something in an application that has a "save to PDF" built in.
-
Dec 7th, 2017, 09:07 AM
#4
Re: Best way to save form to PDF
Originally Posted by passel
On my system I have the option of using "Microsoft Print to PDF" in my printer selection. I don't know if that is provided by the Operating System, or came as part of installing some other Microsoft application. I don't think it is the most efficient, as it creates a much larger PDF file than if I use something in an application that has a "save to PDF" built in.
I didn't even think of that but you're quite right. If there's a PDF printer driver installed, which you can do yourself if there isn't one by default, then you can print straight to PDF. The selection of the printer driver would be done by the user at run time and your code would print using a PrintDocument, just as you would if you were printing on paper. I'm guessing that the file size is likely due to a page being one big image rather than parts containing text, etc.
-
Dec 10th, 2017, 12:37 PM
#5
Re: Best way to save form to PDF
Integrations from like Microsoft Word are about the only way to save files to PDF in vb.net, sadly. There is plently of costly solutions, but you need a deep pitted wallet for that. They cost anywhere from 1500-4500$ a license
Disclaimer: When code is given for example - it is merely a example. •
•
•
Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|