The scenario we have is that we have a gdviewer on a windows form which is not visible to the user.
We use the viewer to send files to print so the user never sees the file in the viewer but they can select print settings.
What I really need to do is to size the file to the page size the user selects, so if the image is say A3 and the user selects to print at A4 aor A5 I need to size the image to the print size.
Have you any ideas on how I can do this? It looks like I could size the image to the size of the viewer, but that would not be the size the user is printing at. Could I maybe size the invisible viewer to be the size the user is printing at then use the zoom mode on the viewer?
From the documentation:
GdViewer.PrintDialogFit () Invokes the standard Windows Printer Dialog, which allows users to choose the printer settings, then prints the displayed document adjusting pages size to the default paper size.
GdViewer.PrintDialogFit (IWin32Window) Invokes the standard Windows Printer Dialog, which allows users to choose the printer settings, then prints the displayed document adjusting pages size to the default paper size.
This function allows to specify the top-level window that will own the modal dialog box.
I set the printer settings myself on the gdviewer before sending the file to print but I found a similar thing with the print method to the print dialogue in that there is a Print() method and a PrintToFit() method since posting this topic.
Using PrintFit() works much better but I am experiencing a problem with it....
If I print in A4 it works fine and prints to fit the page great. But, if I print to A4 Landscape it sizes the image as if it is printing to Portrait. Is this a bug or do I need to set something else?
My code is like this (notice I set the orientation and use printfit() )...
PrinterSettings printerSettings = _printSettings[batchPrintAttachmentInfo.ID];
gdViewer1.PrintSetColorMode(printerSettings.DefaultPageSettings.Color ? PrinterColorMode.PrinterColorModeColor : PrinterColorMode.PrinterColorModeGray);
gdViewer1.PrintSetOrientation(printerSettings.DefaultPageSettings.Landscape ? PrinterOrientation.PrinterOrientationLandscape : PrinterOrientation.PrinterOrientationPortrait);
// Send the file to print
Who is online
Users browsing this forum: No registered users and 2 guests