如何获取(子)文件夹中pdf的总页数?
我喜欢得到这样的回报:
c:\pdfs\path1 83
c:\pdfs\path2 12
c:\pdfs\path2\subfolder 3
etc.
使用下面的代码,我可以得到每个pdf文件的总页数。但这不是我需要的。我想要得到每个文件夹的总数。
REM PDF-Pages.cmd
@echo off
del output.txt
for /r %1 %%f in (*.pdf) do pdfinfo.exe -meta "%%f" >out.txt & echo "%%f",, | tr.exe -d
我使用使用itext.dll生成PDF,我想在我的文档中使用如下形式的页脚:
Page 1 of 6
HeaderFooter footer = new HeaderFooter(new Phrase("Page"), new Phrase(" of 6"));
footer.setBorder(Rectangle.NO_BORDER);
footer.setAlignment(Element.ALIGN_CENTER);
document.setFooter(footer);
在不硬编码总页数的情况下,这是可
我使用以下内容来获取PDF文档中的总页数:
identify -format %n test.pdf
然后,我去掉所有非数字字符,从响应中获得一个整数。
有时会产生以下错误,这会导致上述代码生成不正确的页数,因为它们是与响应中的页面无关的其他数字。
**** Warning: Fonts with Subtype = /TrueType should be embedded.
The following fonts were not embedded:
Arial
Arial,Bol
我正在使用pdfjs加载和合并一些pdf文件。我知道如何显示pdf文档的页码,但在合并文件时,我想显示基于所有pdf文档的总页数的页码。但是因为它是异步的,所以仅仅使用和递增计数器变量是不起作用的。
var actual_page = 1;
(async function loop() {
for (url_item of urls) {
var loadingTask = pdfjsLib.getDocument(url_item);
await loadingTask.promise.then(function (pdf) {
let i
我有一个包含5个pdf文件的列表,每个文件包含20页(假设)。我必须获取所有文件的总页数。答案将是100页。 我已经尝试过了: val totalNumberOfFile = new File(uploadFolderPath)
val fileList = totalNumberOfFile.listFiles()
val totalPages = fileList.map(file => PDDocument.load(file).getNumberOfPages).sum 它为我提供了所需的答案,但我的问题是:-这是在scala中完成此操作的最佳方法吗
我有以下代码
kendo.drawing.drawDOM(tempContainer, {
paperSize: "A4",
landscape: false,
template: $("#page-template").html()
}).then(function(group) {
//here I need total number of pages produced by kendo
return kendo.drawing.exportPDF(group);
}).done(function(data) {