PDF Prints as Landscape instead of Portrait

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF PrintManager for .NET (v4)  /  PDF Prints as Landscape instead of Portrait

DynamicPDF PrintManager for .NET (v4) Forum

We are using Dynamic PDF Printing version 4.15 and printing reports generated by SSRS. There were some new printers introduced and suddenly we are printing as Landscape instead of Portrait, which is how the PDFs are rendered. We can print the same PDF to other HP printers without issue. The printers are models:

•        Kyocera 6003i KX
•        Kyocera 3212i KX

Printing from Windows 10. The printers are network printers.  Are there any known issues with Kyocera printers and DynamicPDF Printing?
Posted by a ceTe Software moderator
Hi,

DynamicPDF PrintManager sends the same PDF data to all printers, and it is up to the printer and its printer driver to handle the printing. There are no known issues with Kyocera printers. Here are a couple things you can try:

 - Check for an updated printer driver.
 - Check the printer option and see if there is anything that may be causing this.

Thanks,
ceTe Software Support Team
We are not doing anything as far as we know to the print options that would cause this. We have a standard set of code that we print these reports through and it has always worked properly for a few years.  Here's the code that we use to actually print the pdfs:

public void PrintAllPdf()
{
try
{
ceTe.DynamicPDF.Printing.InputPdf _pdfDoc2 = new ceTe.DynamicPDF.Printing.InputPdf(_printConfig.PDFContent);//contains our PDF byte array.
_pageCount = _pdfDoc2.Pages.Count;
ceTe.DynamicPDF.Printing.PrintJob _printJob;
var printer = new Printer(_printConfig.CheckPrinterName);
var checkPaperSource = printer.PaperSources.FirstOrDefault(x => x.Name == _printConfig.CheckPaperSource.SourceName);



//Printing first page
ceTe.DynamicPDF.Printing.Printer _checkPrinter = new ceTe.DynamicPDF.Printing.Printer(_printConfig.CheckPrinterName);
_printJob = new ceTe.DynamicPDF.Printing.PrintJob(_checkPrinter, _pdfDoc2, 1, 1);//we allow printing the first page to a different printer/tray than the rest of the report (checks and the first page always contains the check data which prints on check stock).
var page1 = _printJob.Pages[0];
page1.PrintOptions.Inherit = false;
page1.PrintOptions.PaperSource = checkPaperSource;
_printJob.Print();
_printJob.Dispose();



//Printing rest of the pages
if(_pageCount>1)
{
printer = new Printer(_printConfig.PaperPrinterName == null ? _printConfig.CheckPrinterName : _printConfig.PaperPrinterName);
var tailpaperSource = printer.PaperSources.FirstOrDefault(x => x.Name == _printConfig.TailPaperSource.SourceName);
ceTe.DynamicPDF.Printing.Printer _pagePrinter = new ceTe.DynamicPDF.Printing.Printer(_printConfig.PaperPrinterName);
_printJob = new ceTe.DynamicPDF.Printing.PrintJob(_pagePrinter, _pdfDoc2, 2, _pageCount - 1);
foreach(var page in _printJob.Pages)
{
//this is a recent update. We were using SetPaperSourceByName, but we found that it was still always using the Automatically Selected paper source, so we switched to setting it manually on all pages of the report.
//_printJob.PrintOptions.SetPaperSourceByName(_printConfig.PaperSource.ToString());
page.PrintOptions.Inherit = false;
page.PrintOptions.PaperSource = tailpaperSource;
}
_printJob.Print();
_printJob.Dispose();
}
}
catch (Exception e)
{
throw;
}
}
Posted by a ceTe Software moderator
Hi,

Please try setting the page orientation to Portrait and see it works for you.

Here is a code sample:

            page1.PrintOptions.Orientation.Type = OrientationType.Portrait;

Also, please check the printer settings for page orientation on this specific printer and see whether it is set for Landscape as default.

Thanks,
ceTe Software Support Team
Thanks for the feedback. We can't force the orientation because these are generic printing apps and it may be different from report to report. Plus when they print to an HP printer it works as configured in SSRS.

I will have the client check on the default printer settings for the machine they are printing from to see if it is set there, that's a great suggestion.

Thanks!

All times are US Eastern Standard time. The time now is 3:39 AM.