Hello,
The following here under I have attached is to put a pdf content in the horizontal center from left aligned content (for example), but I can not get any content shown in the pinted paper (nothing appears)
Please help me for this subject.
Thanks,
HB
// Create PdfViewer object
PdfViewer viewer = new PdfViewer();
// Open input PDF file
viewer.BindPdf(dataDir + @"\" + name + ext);
// Set attributes for printing
//viewer.AutoResize = true; // Print the file with adjusted size
//viewer.AutoRotate = true; // Print the file with adjusted rotation
viewer.AutoResize = false; // Print the file with adjusted size
viewer.AutoRotate = false; // Print the file with adjusted rotation
viewer.PrintPageDialog = false; // Do not produce the page number dialog when printing
//viewer.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Justify;
viewer.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
// Create objects for printer and page settings and PrintDocument
//System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();
// Set printer name
//ps.PrinterName = prtdoc.PrinterSettings.PrinterName;
// Set PageSize (if required)
//pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
int width = (int)(210 / 0.72 * 25.4);
int height = (int)(297 / 0.72 * 25.4);
pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", width, height);
//pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);
// Set PageMargins (if required)
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);