PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

problem? printing using sample PreviewForm
http://forum.pdfsharp.com/viewtopic.php?f=2&t=250
Page 1 of 1

Author:  pbturner [ Thu Nov 01, 2007 4:13 pm ]
Post subject:  problem? printing using sample PreviewForm

created a small C# application based on some of the c# samples. the top 1/3 of the page is text and lines. below that, there is a BMP graphic that gets loaded onto the form. when i show the PreviewForm, i see the graphic as it should be (scaled to the page so it'll fit), but clicking on print, the graphic goes off the page. clicking on CreatePDF, i'm presented with an Adobe Reader window with the graphic sized correctly. from here, if i click on print, the page is printed as it looks on the form, and on the original preview form. is there something in the PreviewForm print that should be updated? if not, any other ideas? i like the preview form and it's features, but could "roll my own" set of functions that goes directly to the Adobe Reader, but don't think it'd be as graceful. maybe i'm doing something wrong in loading the graphc??

thanks,

Pete Turner
Sun Nuclear Corp.

Author:  Thomas Hoevel [ Mon Nov 05, 2007 9:50 am ]
Post subject: 

I have no explanation.
It could be there's a bug in the renderer used for printing that is not present in the PdfRenderer.

Maybe there's something unusual about the BMP.

Author:  pbturner [ Tue Nov 06, 2007 8:29 pm ]
Post subject: 

what my application does is to build a "form" then display it using the preview sample. from there, if you click on print, the displayed form ends up being larger than the paper for the printer. but, if you click on create PDF, the image in the PDF viewer is fine, as is the printout.

doing a bit of digging, in the PrintPage function of the PreviewForm, there's a line with PageSizeConverter. the "default" is PageSize.A4. if i change this to PageSize.Letter, the printout is better, but it's still too big. is there an argument that can be substituted for the XSize... calculation so that the graphics image that is copied into the gfx structure is a 1 to 1 (same size) copy of the original?

Author:  pbturner [ Tue Nov 06, 2007 9:24 pm ]
Post subject: 

in the mean time, i made the MakePDF function public in the PreviewForm file, and, from my form, instead of calling form.ShowDialog to show the preview form, i call form.MakePDF. it goes right to the PDF viewer. from there, i have similar abilities to the preview form (smaller, larger, save, print, etc).

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/