任何一个可以帮助我,我怎么能砍的PDF页面等作为的Acrobat专业?
Can any one help me that how can I cut the PDF page like as Acrobat professional?
本的片断可以帮助你:
public static void CropDocument(string file, string oldchar, string repChar)
{
int pageNumber = 1;
PdfReader reader = new PdfReader(file);
iTextSharp.text.Rectangle size = new iTextSharp.text.Rectangle(
Globals.fX,
Globals.fY,
Globals.fWidth,
Globals.fHeight);
Document document = new Document(size);
PdfWriter writer = PdfWriter.GetInstance(document,
new FileStream(file.Replace(oldchar, repChar),
FileMode.Create, FileAccess.Write));
document.Open();
PdfContentByte cb = writer.DirectContent;
document.NewPage();
PdfImportedPage page = writer.GetImportedPage(reader,
pageNumber);
cb.AddTemplate(page, 0, 0);
document.Close();
}
上一篇:能否" Android的库更新"相位,以某种方式加快?相位、方式、QUOT、Android
下一篇:为什么XmlTextReader的自动转换HTML连接codeD UTF8字符为utf8字符串?字符串、字符、HTML、XmlTextReader