PDF documents don't require space characters to be present in the page content streams to visually break words. As a consequence, a glyph for the space character may be missing as well in font programs. PDF compliant viewers appear to use font metrics and text state to infer an appropriate word spacing width and check it against characters positioning to add missing spaces when selecting/copying text. Unfortunately the PDF specification appears to not stress enough how word spacing width can be computed in such cases. While pdf.js appears to hard code a size for tracking word breaks, from my empirical tests it seems a different approach is used by Acrobat Reader/Pro. What it could be such heuristic?
How Adobe Acrobat does break words in PDF documents when copying text?
173 Views Asked by ceztko At
1
There are 1 best solutions below
Related Questions in PDF
- Itext get special letters from pdf
- Carrierwave file upload with different file types
- Get text from a section of a pdf page with IcePdf
- itext pdf to image convert
- PDF to Text extractor in nodejs without OS dependencies
- PDF to ByteArray Conversion
- Opening PDF file in SWT Browser - XulRunner default viewer
- Generate TCPDF output to a shared drive folder
- Combine base and ggplot graphics in R figure window in different pages
- Updating a PDF Barcode Field in iOS and Android Device
- Prevent PDFsharp from saving an image file?
- Adding attachment links between lines in itext for pdf
- Crop Pdf from each edge using itextshap
- How to create a PDF with iText+XMLWorker from servlet using custom font?
- how to create a pdf editor for grails
Related Questions in TEXT
- Delete the extra space after special character in all the lines of text file
- Apply gaussian filter on text
- text show and hide with button php/js
- Get text from a section of a pdf page with IcePdf
- load word file (.docx) in richtextbox
- Display a specific line in a text file - android/java
- how to change text direction to the right slide of switch in android?
- C language - Read specific data from text file
- Read text file from specific position and store in two arrays
- How to animate text
- Detect repetition in text string / copied text
- Use MATLAB's webread to login to website and extract text
- LWJGL Drawing colored text to the screen issue
- Hide part of text temporarily, show after user clicks certain element
- Reading text file in java using scanner
Related Questions in WHITESPACE
- How do I wrap text in a pre tag for Internet explorer?
- Perl and Regex - single line mode matching
- How to enter an escape sequence when using ProcessBuilder to open Windows file explorer and highlight the file?
- Removing space in dataframe python
- disable whitespace checks for C++ files in vim syntastic
- Whitespaces in a TextView
- Javascript - Remove space- not breaks
- Unwanted Space Between <header> and <nav>
- How to find out what's adding whitespace on a web page?
- Can't call system with white space in parameter
- Remove space from a filename
- Regex in xCode: any number of any whitespace characters including "end of line"?
- White spaces getting removed on generating csv files from HTML dropdown list
- Beyond Compare 3.3.10 ignores checkboxes for 'leading whitespace" and "embedded whitespace"
- Preserving Tab-Space with XSL-FO
Related Questions in PDF-VIEWER
- Input stream to pdf on Android
- Is it possible to open each hyperlinks inside the pdf in various tabs of the browser?
- trying to generate a PDF and view or email it with React Native
- How do I load and view a PDF file in my app?
- View PDF in browser without Download (Something like gmail attachment)
- PDF VIewer android
- How do I use the PDFViewer.jar library in android?
- Android - Load PDF file without downloading or using google docs?
- unable to access the link of pdf in iphone
- .net PDF Viewer control
- PDF view in blackberry?
- Flutter PDF Viewer shows only white pages
- Flutter 'owner!._debugCurrentBuildTarget == this': is not true. #87
- How to omit subfolders from node_modules for ngx-extended-pdf-viewer
- How to View PDF Files in Android WebBrowser using Java Script in Phonegap?
Related Questions in PDF-SPECIFICATION
- PDF dictionary object logic
- Detect PDF form field radio button (radiobutton) shape / style
- PDF formfield radiobutton syntax latex3 generation
- Adding certification / docMDP signature using openPDF
- PDF Formfield font size: Default appearance vs. appearance stream
- How Adobe Acrobat does break words in PDF documents when copying text?
- Manual creation of pdf files without using third party libs
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The question is very technical and answering it requires either having some insider knowledge of Adobe Acrobat internals or having implemented text extraction in PDF documents with a robust set of test cases that were compared against Adobe results. To whom it may concern, assuming a robust words break algorithm for text extraction can be implemented by inferring an arbitrary spacing width and comparing against glyphs location, the heuristic I'm currently testing is the following:
unscaledSpacingWidth = (average of non zero glyph widths obtained from
/Wor/Widthsarrays) /7Where
7is an arbitrary constant which seems to work well and match Adobe Acrobat results close enough in a limited set of samples I tested. This compares against the solution in pdf.js which is just picking an hard-coded value of0.1PDF points.The found spacing width is subjected to scaling according to font size and other text state context.