Printing to PDF
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Printing to PDF

  1. #1
    Join Date
    Jun 2013
    Posts
    4

    Printing to PDF

    Hello!

    I need an advice about a problem that haunts me lately. I develop a suite of applications and some of them are generating documents (invoices, report etc.). Not a single problem to preview or print them, but i want to be able to save the documents as PDF, preferably using a PDF virtual printer. I found some solutions, but in all of them, i have to insert the PDF file name manually and i need/want that to be done as an automated process (the names of the documents are generated by applications, using a predefined set of rules).

    Any idea/suggestion/advice is welcome.

    Thanks!

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Printing to PDF

    have a look at ceTe dynamic PDF

    The evaluation Version is normally sufficient to generate PDF reports.. some of the Advanced PDF Drawing routines are disabled, but you can place text and draw lines.. which is all we needed...

    We now simply generate all reports in PDF, and use Adobe to display...

    what I also like is that you can generate a Page template that it will use for the current report, that it will use as a base for all pages in that report..

    Also it allows you to programatically generate a file name, and allows you to keep a history of all reports generated..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,091

    Re: Printing to PDF

    You could also consider iTextSharp :

    http://www.codeguru.com/columns/vb/m...b.net-2012.htm

  4. #4
    Join Date
    Jun 2013
    Posts
    4

    Re: Printing to PDF

    Thank you, but is not exactly what i need. The main issue is the graphic layout of the documents (as you can see in attached image). That's why i was thinking of a virtual PDF printer. But i need to send the file name automatically, not inserting it manually, as Nitro PDF Printer or similars are working.

    Document example:
    Name:  DemoDoc.png
Views: 64
Size:  56.9 KB

  5. #5
    Join Date
    Jun 2013
    Posts
    4

    Re: Printing to PDF

    Using a PDF generator means to re-write the whole code for documents. It is a very laborious work and clock is ticking!

  6. #6
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,634

    Re: Printing to PDF

    CutePDF supports bypassing of the Save As dialog. See http://www.cutepdf.com/support/faq.asp
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

  7. #7
    Join Date
    Jun 2013
    Posts
    4

    Re: Printing to PDF

    That's what i'm looking for!

    Thank you S_M_A, i'm in your debt!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center