title: How to modify a pdf file's trimbox with itextsharp
body: <p>I have a ready made PDF, and I would need to modify the trimbox, bleedbox with SetBoxSize and use the setPDFXConformance. Is there a way to do this?</p>
  
  <p>I've tried with stamper.Writer, but it doesn't care about what I set there</p>
  
  <p>2011.02.01.<br>
  We've tested it with Acrobat Pro, and it said that the trimbox was not defined. It seems the the stamper's writer's methods/properties don't effect the resulting pdf.   Here are the source and result files: <a href="http://stemaweb.hu/pdfs.zip" rel="nofollow">http://stemaweb.hu/pdfs.zip</a>  </p>
  
  <p>my code:</p>
  
  <pre><code>PdfReader reader = new PdfReader(@"c:\source.pdf");
  PdfStamper stamper = new PdfStamper(reader, new FileStream(@"c:\result.pdf", FileMode.Create));
  stamper.Writer.SetPageSize(PageSize.A4);
  stamper.Writer.PDFXConformance = PdfWriter.PDFX32002;
  stamper.Writer.SetBoxSize("trim", new iTextSharp.text.Rectangle(20, 20, 100, 100));
  PdfContentByte cb = stamper.GetOverContent(1);
  /*drawing*/
  stamper.Close();
  </code></pre>
  
  <p>Because the boxes are not visible, I tried to modify the pagesize with the writer but that didn't do anything either.</p>