16
2015
10

C# Crop PDF File

 

   static void cropiTxtSharp()
   {
        string file ="C:\\testpdf.pdf";
        string oldchar = "testpdf.pdf";
        string repChar = "test.pdf";
        PdfReader reader = new PdfReader(file);
        PdfDictionary pageDict;
        PdfRectangle rect = new PdfRectangle(0, 1000, 600, 115);
        pageDict = reader.GetPageN(1);
        pageDict.Put(PdfName.CROPBOX, rect);
        PdfStamper stamper = new PdfStamper(reader, new FileStream(file.Replace(oldchar, repChar), FileMode.Create, FileAccess.Write));
        stamper.Close();
        reader.Close();
    }


« 上一篇下一篇 »

相关文章:

Crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece  (2015-10-16 9:1:54)

Crop Pdf from each edge   (2015-10-16 8:58:46)

万兴PDF编辑器 Wondershare PDF Editor  (2014-6-12 12:30:44)

PDF转word  (2014-2-25 16:47:38)

Aspose.PDF功能介绍  (2014-2-20 16:47:23)

Excel转PDF的方法  (2014-2-19 20:20:48)

Aspose.Pdf for .NET实现PDF转Excel、EPS、SVG等  (2014-2-16 16:26:25)

itextsharp去除PDF内的水印  (2014-2-14 14:3:43)

iText去除PDF水印  (2014-2-14 13:29:35)

PDF解析  (2014-2-13 8:46:18)

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。