---
title: "Force to print in legal paper"  
description: "Force to print in legal paper"  
author: "Anonymous User"  
published: 2014-12-05  
updated: 2014-12-05  
canonical: https://www.mindstick.com/forum/12746/force-to-print-in-legal-paper  
category: "asp.net"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Force to print in legal paper

I'm using iTextSharp to generate PDF [documents](https://www.mindstick.com/articles/156931/the-main-types-of-business-documents) in my [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) application. That works great. The only issue I have is when I generate a PDF [document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool) with size of a [legal](https://www.mindstick.com/articles/43952/legal-issues-for-stress-at-work) paper and [print](https://www.mindstick.com/blog/301752/types-of-3d-printing-technology) it, the printer use the [default](https://www.mindstick.com/interview/12771/what-is-the-importance-of-default-resources) paper which is letter size. I have to change the [printing](https://www.mindstick.com/blog/63804/5-ways-you-can-use-printing-in-your-marketing-strategy) [options](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas) manually in [order](https://www.mindstick.com/articles/12276/how-timely-order-deliveries-can-improve-customer-experience) to print it in legal paper. Is there a way I can specify in which paper size I want the document to print programmatically so that I won't have to do it manually?

I'm using this line of code to specify the [page size](https://www.mindstick.com/forum/250/page-size) in iTextSharp:

Document doc = new Document(PageSize.LEGAL.Rotate());

## Replies

### Reply by Allen Scott

The key is to set the viewer preference Choose paper source by PDF page size to true.

writer.AddViewerPreference(PdfName.PICKTRAYBYPDFSIZE, PdfBoolean.PDFTRUE);

### Reply by Mark M

You cannot control the client printer. That would be a huge security problem in the PDF format. It is up to that computer's settings.


---

Original Source: https://www.mindstick.com/forum/12746/force-to-print-in-legal-paper

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
