|
However if I take that base64 string, convert it to a byearray and loading it into the PdfDocumentView via a PdfLoadedDocument I get what seems to be a document centered in a A4 size. If i try and print on custom paper the document is way off. |
We suggest passing the printer setting page size to be fit. It will print the document after fitting the content.
| |
|
How do I specify that I want to print the PDF data at a certain size? |
It is possible to print the PDF data at custom size. Please find the sample to achieve the same.
Sample Link:
|
Hi Pat,Greetings from Syncfusion,
However if I take that base64 string, convert it to a byearray and loading it into the PdfDocumentView via a PdfLoadedDocument I get what seems to be a document centered in a A4 size. If i try and print on custom paper the document is way off. We suggest passing the printer setting page size to be fit. It will print the document after fitting the content.
documentView.PrinterSettings.PageSize = PdfViewerPrintSize.Fit; How do I specify that I want to print the PDF data at a certain size? It is possible to print the PDF data at custom size. Please find the sample to achieve the same.Sample Link:Please check with the provided information and let us know if it helps.Regards,Karthik.
|
>>//100 is used as the DPI value of the printer<<
During our conversation this morning you guys said i needed to use the DPi that was valid for the chosen printer but this looks like you are hardcoding it. Have i misunderstood?
|
We already mentioned that there is no need to use this code, when custom paper size in available in the target printer.
The DPI of different machines will be different which is based on screen resolution. And this setting will only affect the printed output in virtual printers of the machine. Hence, we included the 100 as DPI value of the printer which is required only for virtual printers.
As you are using the physical printer, you can execute the project without using the DPI value as it would automatically detect the DPI of the target printer. I have attached the output file of virtual printers with and without using the DPI value for your reference below.
|
|
The PdfUnitConvertor that is used in the PrintPage event is not initialised with the same arguments as the one used when first creating the PrintDocument. Is this correct? |
Yes. Page content DPI value is different for various monitor resolutions. In this state, parameter value of PdfUnitConvertor will be updated with default DPI value.
|