I am trying to use the Aspose.PDF.Facades to generate a PDF with fields filled in. This I have working (see code below). My problem comes when I try to print the resulting PDF using PDFViewer. My input PDF is 2 pages and is set within that form to be duplex. When I print it with the code below - I get 2 separate pages - the first page has the field (as a barcode) on it - the barcode does not print. Page 2 looks just fine-except that it should be on the back side of page 1. Also - if I open the resulting PDF with Adobe Reader and print it - all prints fine (the data field is filled in and printed and it prints front and back).
Thanks
Code to generate the PDF.
Dim pdf2 As New Aspose.Pdf.Facades.Form
pdf2.BindPdf(“c:\it\wcstestaspose\CSS Response Static.pdf”)
pdf2.FillField(“form1.bcCCSNumber”, “123123”)
pdf2.Save(“c:\it\wcstestaspose\output.pdf”)
Code to Print PDF
Dim viewer As New PdfViewer()
viewer.BindPdf" c:\it\wcstestaspose\output.pdf")
viewer.AutoResize = True 'Print the file with adjusted size
viewer.AutoRotate = True 'Print the file with adjusted rotation
viewer.PrintPageDialog = False 'Do not produce the page number dialog when printing
'Create objects for printer and page settings and PrintDocument
Dim ps As New System.Drawing.Printing.PrinterSettings()
MsgBox(ps.CanDuplex) '- this returns True
Dim pgs As New System.Drawing.Printing.PageSettings()
Dim prtdoc As New System.Drawing.Printing.PrintDocument()
ps.PrinterName = prtdoc.PrinterSettings.PrinterName
ps.Duplex = True
'Print document using printer and page settings
viewer.PrintDocumentWithSettings(pgs, ps)
viewer.Close()