Fix unexpected page count error

This commit is contained in:
EnumDev committed 2026-10-12 14:24:08 +03:00
1 parent 79ab38a429
commit 88b4258636
3 files changed
+35 -1

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
name: libcupsfilters
description: OpenPrinting CUPS Filters library
version: 2.2.1
revision: 1
revision: 2
url: https://github.com/OpenPrinting/libcupsfilters
license: Apache-2.0 WITH LLVM-exception
maintainers:
+9
View File
@@ -2,6 +2,15 @@
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"
patch -Np1 -i "$BPM_WORKDIR"/167.patch
autoreconf -fi
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
+25
View File
@@ -0,0 +1,25 @@
From a9acdb22cc898076bf6c5d9d20474274ed123458 Mon Sep 17 00:00:00 2001
From: szlt5 <[email protected]>
Date: Thu, 23 Jul 2026 12:40:12 +0800
Subject: [PATCH] Fix printing error: pdfio output "Missing Root object."
---
cupsfilters/pdf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cupsfilters/pdf.c b/cupsfilters/pdf.c
index 1f714b203..3e4386091 100644
--- a/cupsfilters/pdf.c
+++ b/cupsfilters/pdf.c
@@ -165,6 +165,11 @@ cfPDFPagesFP(FILE *file) // I - File pointer of PDF
fwrite(buffer, 1, bytes_read, temp_fp);
}
+ // call fflush(temp_fp) to flush the stdio buffer;
+ // otherwise pdfioFileOpen() may not see the complete contents of temp_filename because
+ // some data may still be buffered and not yet written to the file.
+ fflush(temp_fp);
+
// Open the temp file with pdfio
pdfio_file_t *pdf = pdfioFileOpen(temp_filename, NULL, NULL, NULL, NULL);