jrmuizel / pdf-extract

A rust library for extracting content from pdfs
388 stars 77 forks source link

Panics with message "no widths" #94

Open xrl1 opened 3 weeks ago

xrl1 commented 3 weeks ago

While trying to parse the following random PDF: 0000988.pdf

the thread panics:

stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:686:12
   1: pdf_extract::PdfSimpleFont::new
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:594:13
   2: pdf_extract::make_font
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:330:17
   3: pdf_extract::Processor::process_stream::{{closure}}
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:1620:84
   4: std::collections::hash::map::Entry<K,V>::or_insert_with
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/collections/hash/map.rs:2666:43
   5: pdf_extract::Processor::process_stream
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:1620:32
   6: pdf_extract::output_doc
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:2238:9
   7: pdf_extract::extract_text
             at /home/lior/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.7/src/lib.rs:2133:9
   8: balbla::pdf_parser::get_text_from_path
jrmuizel commented 2 weeks ago

It looks like this PDF is missing the required Widths array. I'll see what other PDF readers do in this situation and try to handle it better

xrl1 commented 2 weeks ago

This is what the pdfium-render crate outputs as text:

Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
Honda D15b
Engine Wiring
Diagram
Fbclid Iwar0cu
jq7rleamyveia
wib4epuxu9 4
d6ayx34gdym
6mihcy6df7ios
rz5bu
Page 1/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
When somebody
should go to the book
stores, search
inauguration by shop,
shelf by shelf, it is
essentially
problematic. This is
why we offer the book
compilations in this
website. It will entirely
ease you to see guide
honda d15b engine
wiring diagram fbclid i
war0cujq7rleamyveia
Page 2/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
wib4epuxu9 4d6ayx3
4gdym6mihcy6df7iosr
z5bu as you such as.
By searching the title,
publisher, or authors
of guide you truly
want, you can
discover them rapidly.
In the house,
workplace, or perhaps
in your method can be
all best place within
net connections. If
Page 3/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
you aspire to
download and install
the honda d15b
engine wiring diagram
fbclid iwar0cujq7rleam
yveiawib4epuxu9 4d6
ayx34gdym6mihcy6df
7iosrz5bu, it is entirely
simple then, back
currently we extend
the link to buy and
create bargains to
download and install
honda d15b engine
Page 4/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
wiring diagram fbclid i
war0cujq7rleamyveia
wib4epuxu9 4d6ayx3
4gdym6mihcy6df7iosr
z5bu suitably simple!
Bootastik's free Kindle
books have links to
where you can
download them, like
on Amazon, iTunes,
Barnes & Noble, etc.,
as well as a full
Page 5/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
description of the
book.
JDM-D15B-VTEC-O
BD1-5-SPEED-MANU
AL-TRANSMISSION
The official parts look
up site for Honda
Engines. Look up and
order parts for Honda
GX, GC, GCV, and
GXV small engines. A
complete parts
Page 6/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
catalog is available.
Honda D15b Engine
Wiring Diagram
AutoZone Repair
Guide for your
Chassis Electrical
Wiring Diagrams
Wiring Diagrams.
Circuit Protection;
Component
Locations; Cruise
Control; ... Honda
Page 7/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
Civic/CRX/del Sol
1984-1995 Repair
Guide. WIRING
DIAGRAMS Repair
Guide ... Engine
wiring-1985-87 Civic
Sedan, Wagon and
Hatchback (all 1.5L)
2000 civic ex wiring
nightmare |
ClubCivic.com -
Honda ...
Description: 92 Civic
Page 8/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
D15 Engine Harness
Diagram – HondaTech – Honda Forum
regarding Honda Civic
2005 Engine
Diagram, image size
726 X 780 px, and to
view image details
please click the
image.. Here is a
picture gallery about
honda civic 2005
engine diagram
complete with the
Page 9/29Read PDF Honda
D15b Engine
Wiring Diagram
Fbclid Iwar0cujq7r
leamyveiawib4epu
xu9 4d6ayx34gdy
m6mihcy6df7iosrz
5bu
description of the
image, please find the
image you need.
Compatibility List &
Wiring Diagrams -
VTEC
This video
demonstrates the
Honda Civic Wiring
Diagrams and details
of the wiring harness.
Diagrams for the
following systems are
Page 10/29

I switched to using it even though it needs the entire c++ library with it, but my program requires no panics so I can't use pdf-extract until all the panics are transformed into Result.

pvichivanives commented 4 days ago

@xrl1 just wanted to mention that I've used std::panic::catch_unwind() as a mitigation for now in case you can use the same tactic.

xrl1 commented 4 days ago

@pvichivanives catch_unwind is useful only when someone wants to terminate their application more gracefully after a panic, but in my case I want to continue running. As far as I understand from documentation, catch_unwind may leave the program in an unstable state and leaked memory, so it is highly discouraged.