I've downloaded the latest Aspose.Pdf for .NET and am still getting this problem.
- COI.doc is the Word document I'm working with
- Word.tif is the result of printing directly from Word.
- Reader.tif is the result of converting the Word document to a PDF and printing from Acrobat reader. Below is the code for converting to PDF.
Dim fs As FileStream = New FileStream(file, System.IO.FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
Dim document As Document = New Document(fs)
Dim ms As MemoryStream = New MemoryStream
Dim saveOptions As PdfSaveOptions = New PdfSaveOptions
saveOptions.SaveFormat = SaveFormat.Pdf
saveOptions.PrettyFormat = True
saveOptions.Compliance = PdfCompliance.PdfA1b
document.Save("C:\development\COI.pdf", saveOptions)
- AsposeSimple.tif is the result of the same basic Word->PDF conversion logic and then the following code to print.
Dim viewer As PdfViewer = New PdfViewer
viewer.OpenPdfFile(ms)
viewer.PrintPageDialog = False
viewer.PrintDocument()
viewer.ClosePdfFile()
- AsposeComplicated.tif is the result of the same Word->PDF conversion and the following logic to print
printerSettings = New PrinterSettings
pageSettings = New PageSettings
printerSettings.PrinterName = "Kyocera TASKalfa 500ci KX"
pageSettings = printerSettings.DefaultPageSettings.Clone()
'pageSettings.Margins.Top = 0
'pageSettings.Margins.Bottom = 0
'pageSettings.Margins.Left = 0
'pageSettings.Margins.Right = 0
'pageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Letter", 850, 1100)
Dim viewer As PdfViewer = New PdfViewer
viewer.OpenPdfFile(ms)
viewer.PrintPageDialog = False
viewer.PrintDocumentWithSettings(pageSettings, printerSettings)
viewer.ClosePdfFile()
Am I doing something wrong? As you can see using PdfViewer is clipping output on the right side of the document.
Thanks,
Will