PdfDocumentView document = new();
document.Load(somePdfStream);
PrintQueue printQueue = new(new PrintServer(), "Microsoft Print to PDF");
PrintTicket requestedTicket = new()
{
PageMediaSize = new(PageMediaSizeName.ISOA4)
};
PrintDialog printDialog = new()
{
PageRangeSelection = PageRangeSelection.AllPages,
PrintQueue = printQueue,
PrintTicket = requestedTicket
};
printDialog.PrintDocument(document.PrintDocument.DocumentPaginator, "test doc");
|
PdfDocumentView document = new PdfDocumentView();
document.Load("../../../HTTP Succinctly.pdf");
document.PrinterSettings.PageSize = PdfViewerPrintSize.Fit; |
|
Query |
Detail |
|
When I use your provided
document.PrinterSettings.PageSize = PdfViewerPrintSize.Fit;
with the printdialog print function
printDialog.PrintDocument(document.PrintDocument.DocumentPaginator, "test doc");
it doesn't have any effect. |
The suggested code snippet to set the Pagesize will reflect only in PdfDocumentView.Print() method and it will not reflect in the sample level PrintDialogue control print settings as it is its behavior. |
|
If I print it with
document.Print("Microsoft Print to PDF");
the output is stretched to the page, instead of keeping the aspect ratio.
Is it possible to instruct the printer to "fit to page" with the correct aspect ratio instead of stretching it?
|
We tried to reproduce the issue “The Printed output was stretched instead of maintain aspect ratio” and we could not reproduce the issue in our end, the printed document with different paper size has the same aspect ratio when we print with “fit” as PageSize.
We have attached the input PDF file and output printed document file for your reference in the below link: https://www.syncfusion.com/downloads/support/forum/159826/ze/PrintwithFit1315263692
Since we could not reproduce the issue, we suspect this might me document specific or due to Paper size related issue. So, we request you to provide the document in which you have faced the issue and also please provide the detail about Paper size which you are trying to print. This information will be helpful for us to analyze more from our side and provide you a better solution.
|