Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 01:41 AM   #1
Ausic
Junior Member
Ausic began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2015
Device: none
Dealing with large wrapped text

Hi MR,

I am using Sigil to create an ePub. The source file is a PDF document. I converted the PDF to word so it makes copying the text to paste into my ePub file easier but the text are wrapped. The text are also wrapped when pasted into Sigil.

I then converted the PDF to text, the text wrap is still present. It will take me a long time to have to unwrap paragraph after paragraph of text. Is there a way to unwrap the text in bulk, for multiple paragraph at the same time?


Click image for larger version

Name:	Screenshot 2026-10-23 063627.jpg
Views:	28
Size:	239.9 KB
ID:	226863
Ausic is offline   Reply With Quote
Old Yesterday, 07:31 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,865
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This has been a problem with pdf conversions forever. It is a terrible source format. It is always better to use whatever the source for creating the PDF was. There are people who will share their regular expressions for unwrapping bad pdf conversions, but nothing is going to be 100% effective. Manual editing and fixing will always be required.

Sigil has nothing inherent to help in this regard.
DiapDealer is offline   Reply With Quote
Advert
Old Yesterday, 07:48 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,402
Karma: 154365103
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Ausic View Post
Hi MR,

I am using Sigil to create an ePub. The source file is a PDF document. I converted the PDF to word so it makes copying the text to paste into my ePub file easier but the text are wrapped. The text are also wrapped when pasted into Sigil.

I then converted the PDF to text, the text wrap is still present. It will take me a long time to have to unwrap paragraph after paragraph of text. Is there a way to unwrap the text in bulk, for multiple paragraph at the same time?


Attachment 226863
I've used AI to convert from PDF to ePub and it works pretty good. Better then most conversion programs.
JSWolf is offline   Reply With Quote
Old Yesterday, 07:57 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,865
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This is not a Sigil topic. This is an age-old PDF conversion issue.
DiapDealer is offline   Reply With Quote
Old Yesterday, 08:25 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 32,025
Karma: 65700000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I have 10 saved searches.
These are ALL really templates and get touched up to match the actual class="..."
Only the simple Join to lower do I ever use 'replace all' (and that is after checking what it does). For the rest, I use Find (this is what you also use to Skip without a replace)

Tip 1 is always 'Reformat: Multiple lines' before using the CSS cleans it adds the optional last ; before the }. And Prettify for the ALL HTML before using.

Tip 2 is to complete the basic cleans like join to lower before STEPPING thru the joins for honorific Be careful on the order you use things with Capitals and Periods
Code:
Mr.</p>
<p class="foo">Smith...
is a case that should be joined with a space and is NOT 2 paragraphs.

Here is a screenshot of my normal saved 'Joins' It is not even 75% of what you will see. Those will still need hand crafting.
Some of mine include support for both curly and straight quotes.

For de-hyphen, I start with Calibre's Editor:Spell check (with the filter set to -) as it offers a joined version as a choice (note: not all words with - are wrong. Never just remove blindly)

Sigil and Calibre are TOOLS. I use both as the ARE different on what and how. Neither is wrong or bad. They fit with the way I do stuff

HTH
Attached Thumbnails
Click image for larger version

Name:	SigilCleanSnR.png
Views:	8
Size:	79.2 KB
ID:	226874  
theducks is offline   Reply With Quote
Advert
Old Yesterday, 09:27 AM   #6
Sarmat89
Fanatic
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 550
Karma: 2268308
Join Date: Nov 2015
Device: none
It's very, very easy. It's just what HTML was made for. Your paragraphs are separated with blank lines; add there a pair of tags </p><p> and you're set.
Sarmat89 is offline   Reply With Quote
Old Yesterday, 12:00 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 29,865
Karma: 212614993
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Sarmat89 View Post
It's very, very easy. It's just what HTML was made for. Your paragraphs are separated with blank lines; add there a pair of tags </p><p> and you're set.
I'm fairly certain that in this instance, it is an overabundance of </p><p> tags that is the problem. Unwrapping broken paragraphs involves removing a lot of extraneous </p><p> pairs, not adding more.
DiapDealer is offline   Reply With Quote
Old Yesterday, 01:43 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 55,315
Karma: 182532776
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Sarmat89 View Post
It's very, very easy. It's just what HTML was made for. Your paragraphs are separated with blank lines; add there a pair of tags </p><p> and you're set.
The most common error I find in PDF conversions are lines that look like:

Code:
...this is a sample</p>
<p>line which continues in a new paragraph...
I use a collection of regexes to correct most of these errors but they are run manually with me going yes/no to each suggested change and not in a full automatic mode since that generally ends up making more problems than it solves.

Adding a <p></p> after each </p> would do nothing to help with this problem.
DNSB is online now   Reply With Quote
Old Yesterday, 02:15 PM   #9
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,915
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
@Ausic

Can you post the code for the text in your screenshot.
Karellen is offline   Reply With Quote
Old Yesterday, 04:45 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 22,882
Karma: 34252744
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I've been doing this for 2-3 PDFs a week for several years.
  • After opening the PDF in Word, I check the Styles, adjust any that don't make sense,
  • Save a DOCX from Word,
  • Open that DOCX in the [Sigil] DOCXImport plugin, which maps the Word Styles in the DOCX to an EPUB Style sheet. (see plugin & Mammoth doco)
The PDFs are from one of two sources. For each source I have a Word template, a Mammoth style map, and a Cascading style sheet.

All I do to the resultant EPUBs is to fix the metadata with Sigil's Metadata Edit tool.

BR
BetterRed is offline   Reply With Quote
Old Yesterday, 08:33 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 85,402
Karma: 154365103
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've used AI to convert some PDF to ePub. The results are actually pretty good.
JSWolf is offline   Reply With Quote
Old Yesterday, 09:03 PM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,514
Karma: 21099999
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by JSWolf View Post
I've used AI to convert some PDF to ePub. The results are actually pretty good.
Echo??
Turtle91 is offline   Reply With Quote
Old Yesterday, 09:31 PM   #13
Sarmat89
Fanatic
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 550
Karma: 2268308
Join Date: Nov 2015
Device: none
Quote:
Originally Posted by DNSB View Post
Adding a <p></p> after each </p> would do nothing to help with this problem.
The right solution is preventing the paragraphs from taking place. Both pdftotext, pdftoxml, or LibreOffice allow for line-based production while still detecting paragraphs. Such plain text can be 'unwrapped' by any HTML viewer.
Sarmat89 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dealing with white text on colored background when prepping PDFs for grayscale or B&W JawadLeLogeur PDF 3 10-29-2025 09:29 AM
Dealing with very large library Torpido Library Management 3 03-11-2016 01:49 PM
Large files to text hackettt Calibre 2 01-06-2011 06:52 AM
Right Aligning Wrapped Text Only ghostyjack ePub 7 11-04-2010 08:54 AM
wrapped text around an image Ambar ePub 2 07-05-2010 08:55 AM


All times are GMT -4. The time now is 02:41 AM.


MobileRead.com is a privately owned, operated and funded community.