PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jul 16, 2024 6:38 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: VB 2010 Form to PDF
PostPosted: Thu Nov 25, 2010 5:03 am 
Offline

Joined: Thu Nov 25, 2010 3:55 am
Posts: 4
In my application I create an Invoice is a VB form and print it as a screen snapshot using BitBlt. I need to provide email functionality and I think creating s PDF using PDFSharp and emailing that pdf file would be the best option. Is it possible to input the BitBlt screen snapshot to PDFSharp? Thank you in anticipation. Brad


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Thu Nov 25, 2010 8:57 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
bradhen wrote:
BitBlt screen snapshot

What's a "BitBlt screen snapshot"? Is it a MemoryDC?

You need an XImage for PDFsharp. XImages can be created from Files and from Images (GDI+ images).

Why don't you e-mail the screen shot as a GIF or PNG file?
A screen shot in a PDF file will still be a screen shot - and when people zoom in or print it it will look like a screen shot.

You might use MigraDoc to re-create the invoice. Fonts will then be smooth even when zoomed at the highest level and it can look like an invoice, not like a screen shot.
Yep, it's extra work - but it might be worth it.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Mon Nov 29, 2010 6:36 am 
Offline

Joined: Thu Nov 25, 2010 3:55 am
Posts: 4
Hello Thomas,
Thank you for your response, I have decided to use PDFSharp's Drawstring capability to create the invoice rather than use VB forms and grab that portion of the screen. By using Drawstring I have more control, however I can't find how to create multiple pages. I won't always know how many pages I will print some invoices are one page some may be 5 or ten pages. I can add a new page using document.addpage() but when I try to use drawstring I overwrite the first page - still referring to the first page. Do you have a sample of creating a multiple page document? Thanks again for an excellent product.
Brad


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Mon Nov 29, 2010 12:27 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
If you create a new page, also create a graphics object to draw on the new page.

Or better use MigraDoc when you need automatic page breaks.
There even is a MigraDoc Invoice sample ...

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Wed Dec 08, 2010 6:09 am 
Offline

Joined: Thu Nov 25, 2010 3:55 am
Posts: 4
Thomas,
The PDFSharp is working well and creating multiple pages. I am having another concern with the document.save, at times its almost immediate and others it can take up to 20-25 seconds to save the file. Is there anything I can do to speed this up??
Thanks again
Brad


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Wed Dec 08, 2010 9:05 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
bradhen wrote:
Is there anything I can do to speed this up??

With PDFsharp there are no performance problems I'm aware of.

So maybe this problem is not with PDFsharp (a hard disk that has to speed up, a network connection causing delay, DDLs being loaded for the first time, or something completely different).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: VB 2010 Form to PDF
PostPosted: Wed Dec 08, 2010 10:41 pm 
Offline

Joined: Thu Nov 25, 2010 3:55 am
Posts: 4
Thanks Thomas,
I'll look elsewhere for the cause. Its very erratic some times the save is immediate other times its up to 28 seconds. Very confusing.

Brad


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 30 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group