PDF printing issue
Posted: Thu Jan 28, 2010 12:50 am
Hi,
I came across two issues when printing pdf file, using GdPicture.Net SDK.
Using version 6.5 to print the attached pdf file on A3 printer, the content was moved towards right and bottom and the right border and the bottom border was cut off. There is no problem printing the attached pdf file using Acrobat Reader.
Using version 6.6 to print the attached pdf file, the clipspec logo image at the left bottom was dropped off completed.
My code is:
Could you please help solve these issues, especially the offset one?
Thank you!
-Bo
I came across two issues when printing pdf file, using GdPicture.Net SDK.
Using version 6.5 to print the attached pdf file on A3 printer, the content was moved towards right and bottom and the right border and the bottom border was cut off. There is no problem printing the attached pdf file using Acrobat Reader.
Using version 6.6 to print the attached pdf file, the clipspec logo image at the left bottom was dropped off completed.
My code is:
Code: Select all
internal static void PrintPDF(PrinterSettings ps, string pdfFile, string documentName, bool landscape, PaperSize paperSize)
{
using (var pdfView = new GdPicture.GdViewer())
{
pdfView.EnableMenu = false;
ps.DefaultPageSettings.PaperSize = paperSize;
pdfView.LockViewer = false;
pdfView.SilentMode = true;
pdfView.PrintSetShowPrintingProgress(false);
pdfView.BorderStyle = System.Windows.Forms.BorderStyle.None;
pdfView.SetLicenseNumber("xxxxx"); // Please replace XXXX by a valid demo or commercial license KEY
pdfView.DisplayFromFile(pdfFile);
pdfView.PrintSetActivePrinter(ps.PrinterName);
pdfView.PrintSetPrinterSettings(ps);
pdfView.PrintSetOrientation(landscape? GdPicture.PrinterOrientation.PrinterOrientationLandscape :
GdPicture.PrinterOrientation.PrinterOrientationPortrait );
pdfView.PrintSetPaperSize(paperSize);
pdfView.PrintSetDocumentName(documentName);
pdfView.PrintSetFromToPage(0, pdfView.PageCount);
pdfView.Print();
pdfView.CloseDocument();
}
}
Thank you!
-Bo