Results 1 to 5 of 5

Thread: Best way to save form to PDF

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2017
    Posts
    32

    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?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    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.

  3. #3
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    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.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Best way to save form to PDF

    Quote Originally Posted by passel View Post
    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.

  5. #5
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,168

    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
  •  



Click Here to Expand Forum to Full Width