使用VB.Net代码获取PDF文件页数 [英] Get PDF file page count using VB.Net code
本文介绍了使用VB.Net代码获取PDF文件页数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我在一个文件夹中有很多PDF文件.我需要使用VB查找每个PDF文件的页数.网络编码.
任何人都可以帮助我.
感谢
Hello Friends,
I have lot of PDF files in one folder. i need to find Page count for each PDF file using VB. net coding.
anyone help me.
thanks
推荐答案
您可以使用此代码获取文件夹中的所有pdf文件
You can get all the pdf files in a folder using this code
Dim allFileNames as String() = _
Directory.GetFiles("C:\PDFFiles", "*.PDF", SearchOption.AllDirectories)
您可以使用此代码获取pdf文件的页数.
and you can get the page count of a pdf file using this code.
Dim pr As New PdfReader("/path/to/yourFile.pdf")
Return pr.getNumberOfPages()
对于每个循环,对于您通过第一个代码获得的每个文件,都将在此代码中进行迭代.
希望对您有帮助
Iterate this code in a for each loop , for every file you get by the 1st code.
Hope this helps
您好Deepak,
谢谢你的帖子.我是VB.net的初学者.请寄给我完整的验证码.对我有用
Hello Deepak,
thanks for your post. i am beginner of the VB.net. please send me the full code. that is useful for me
这篇关于使用VB.Net代码获取PDF文件页数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文