• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

How can I make the PDF be recognized as a different Paper Type on a Commercial Printer?

recently started a project to move reports to be generated as PDFs. I generate many reports into many PDFs. At the end of the Process, I use PDFSharp to combine the results into a single PDF. This has all worked fine.

However, the Printer has 6 different trays. It pulls certain paper for different paper types (Letter, A4, ect...).

My combined PDF and single document PDFs all print on plain white paper. I need invoices to print on perforated paper sources, but I have no way to tell the printer that this paper type is different.

The printer is a KODAK NEXPRESS SX Platform.


How can I make the PDF be recognized as a different Paper Type?

Any advice would be appreciated.
1 Solution
Bob LearnedCommented:
I believe that you need to set the PdfPage.Size property, as shown here:

PDFsharp Sample: Page Sizes

// Create a new PDF document
PdfDocument document = new PdfDocument();
// Create a font
XFont font = new XFont("Times", 25, XFontStyle.Bold);

PageSize[] pageSizes = (PageSize[])Enum.GetValues(typeof(PageSize));
foreach (PageSize pageSize in pageSizes)
if (pageSize == PageSize.Undefined)
// One page in Portrait...
PdfPage page = document.AddPage();
page.Size = pageSize;
XGraphics gfx = XGraphics.FromPdfPage(page);
gfx.DrawString(pageSize.ToString(), font, XBrushes.DarkRed,
new XRect(0, 0, page.Width, page.Height),

// ... and one in Landscape orientation.
page = document.AddPage();
page.Size = pageSize;
page.Orientation = PageOrientation.Landscape;
gfx = XGraphics.FromPdfPage(page);
gfx.DrawString(pageSize + " (landscape)", font,
XBrushes.DarkRed, new XRect(0, 0, page.Width, page.Height),
// Save the document...
const string filename = "PageSizes_tempfile.pdf";
// ...and start a viewer

Open in new window

>> ... different paper types (Letter, A4, ect...) ...

I don't know the answer, but (perhaps backing up the reply from Bob Learned) would like to point out that values such as A4 and Letter are Paper Sizes - typical  Paper Types are Plain and Letterhead.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now