如何使用itextsharp获取pdf文件的高度和宽度和大小 [英] How do I get pdf file height and width and size using itextsharp

查看:848
本文介绍了如何使用itextsharp获取pdf文件的高度和宽度和大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pdfcopy文件正在目标文件夹中复制



我尝试过:



with pdfcopy file is being copying in destination folder

What I have tried:

sourceDocument = new Document();
pdfCopyProvider = new PdfCopy(sourceDocument, new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create));

//Open the output file
sourceDocument.Open();

//  for(int f = 0; f < lstFiles.Count - 1; f++)
// {
reader = new PdfReader(lstFiles[0]);
var pages = reader.NumberOfPages;
importedPage = pdfCopyProvider.GetImportedPage(reader,pages);

var height = Math.Ceiling(Convert.ToDecimal(importedPage.Height));
var width = Math.Ceiling(Convert.ToDecimal(importedPage.Width));
var size = reader.FileLength;

推荐答案

Google搜索有你的答案:如何使用itextsharp获取pdf文件的高度和宽度和大小 - Google搜索 [ ^ ]
Google search has answers for you: How do I get pdf file height and width and size using itextsharp - Google Search[^]


这篇关于如何使用itextsharp获取pdf文件的高度和宽度和大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆