smalot / smalot/pdfparser

Mangled text output

Open
#501 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug PDF required to demonstrate issue
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Hello,

I'm trying to extract text from a generated PDF document. It appears to be a well-formatted document, although it's v1.3. I've opened it in acrobat and copy/pasted into textedit to verify that it's not an embedded font issue. That went fine. I don't know if the information below helps shed any light, or if there's anything else I can do to provide more detail?

aaa@bbb:/path# head -n 15 /xxx/yyy.pdf 
%PDF-1.3
%????
7 0 obj
<<
/Predictor 15
/Colors 1
/BitsPerComponent 8
/Columns 320
>>
endobj
11 0 obj
<<
/Type /ExtGState
/CA 1
>>

This is the output from getDetails():

Producer:	 PDFKit
Creator:	 PDFKit
CreationDate:	 2021-11-06T20:36:50+00:00
Pages:	 9

This is a sample of the mangled text:

>K?)0'C%A0CD#K)SA#.)CB%)0E#Q%)-$%"DSD"0CD#K-)0KM)"#AA%-$#KMDKF)$AD"%)0M/V-C.%KC)cDS)K%"%--0A?d)&D'')E%).0M%)#K'?)0C)CB%)+V-C#.%Ae-)A%[V%-C)#A)0$$A#Q0',)
+#.$'%CDKF)CB%)&#A1)DK)CBD-)IA#$#-0')0C)CB%)CD.%)-"B%MV'%M)D-)"#KCDKF%KC)V$#K)0""DM%KC-)#A)M%'0?-)E%?#KM)#VA)"#KCA#',)7BD-)IA#$#-0')D-)E0-%M)$AD.0AD'?)#K)
CB%)+V-C#.%Ae-)M%-"AD$CD#K)#S)CB%)$A#E'%.,)7BD-)IA#$#-0').0?)E%)&DCBMA0&K)DS)K#C)0""%$C%M)E?)CB%)+V-C#.%A)&DCBDK)34;)M0?-,
>""%$C0K"%)#S)+#KCA0"Cf)X)0.T&%)0A%)0&0A%)#S)0KM)0FA%%)C#)CB%)"#KC%KC-)#S)CBD-)IA#$#-0'()CB%)0CC0"B%M)^#E)N%C0D')-B%%Cc-d()0KM)CB%)0CC0"B%M)*D.DC%M)
R0AA0KC?()cC#F%CB%A()CB%)g+#KCA0"Cgd,)h#V)0A%)0VCB#ADi%M)C#)M#)CB%)&#A1)0-)-$%"DSD%M)DK)CB%)+#KCA0"C,)XT&%)&D'').01%)CB%)$0?.%KC)-%C)S#ACB)DK)CBD-)+#KCA0"C)
0C)CB%)CD.%)DC)D-)MV%,)XT&%)&D'')$0?)?#VA)-%AQD"%)"B0AF%)#S)353THj)$%A).#KCB)c36j)$%A)0KKV.d)DS).?T#VA)0""#VKC)D-)H;)M0?-)#A).#A%)$0-C)MV%()$'V-)?#VA)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names getDetails() and includes PDF 1.3 metadata plus mangled extracted text, but no source file, test, or PDF attachment is provided. Start by obtaining the generated PDF and reproducing extraction, then trace the parser path used for its text streams. Done means this document's extracted text is readable and the failure is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.