Skip to content

Commit f6f4aae

Browse files
Initialize forms in PDF document (#4867)
* Initialize forms in PDF document Initialize forms in the PDF document before processing pages. * Initialize forms in PDF document on load --------- Co-authored-by: Lin Manhui <[email protected]>
1 parent e5b698e commit f6f4aae

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

paddlex/inference/serving/infra/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def read_pdf(
188188
page_info_list: List[PDFPageInfo] = []
189189
with _lock:
190190
doc = pdfium.PdfDocument(bytes_)
191+
doc.init_forms()
191192
try:
192193
for page in doc:
193194
if max_num_imgs is not None and len(images) >= max_num_imgs:

paddlex/inference/utils/io/readers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def __init__(self, rotate=0, zoom=2.0):
297297
def load_file(self, in_path):
298298
"""load pdf file"""
299299
doc = pdfium.PdfDocument(in_path)
300+
doc.init_forms()
300301
return doc
301302

302303
def read_file(self, in_path):

0 commit comments

Comments
 (0)