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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2011, 01:58 PM   #1
MRi
Member
MRi began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2011
Location: Germany, Hessen
Device: Sony PRS-T1
Convert PDF to EPUB with source code in Courier and formated as it was

Hi!
I have a lot of PDF file like this one:
http://www.charlespetzold.com/dotnet/

It has source code passages, that should bekept in pre-tags or the font should be courier. Also paragrahs and indentation should notbe destroyed.

Is this possible. I found it easy to remove footers and headers and to keep the chapters. But I couldn't find a trick to convert the files in a way that the source code is still readable.

Any hint for it?

TIA
- Martin
MRi is offline   Reply With Quote
Old 11-11-2011, 10:35 PM   #2
Serpentine
Evangelist
Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.Serpentine ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 1045911
Join Date: Sep 2011
Location: Cape Town, South Africa
Device: Kindle 3
PDF's don't have tags or anything, so you cant really hope for that to be reliably be converted.

You might want to try importing the XPS version of the book into Word (I'm not sure if Writer has an XPS plugin) you might at least then be able to preserve fonts and most formatting - and export back out as html.

At best with the PDF, I'd say that saving the file out to text and working from there(it preserved indentation of code blocks when I saved it as text from Sumatra) - shouldn't be too tricky to scroll through mark the file up with some basic text for easier editing(since you don't want to run regex over the code/eq's). Strip the header/footer and eventually use regex to unwrap most of the paragraph text. From there throwing it into something like Sigil and mark the rest of it up.
Serpentine is offline   Reply With Quote
Old 11-14-2011, 02:02 AM   #3
MRi
Member
MRi began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2011
Location: Germany, Hessen
Device: Sony PRS-T1
Is there no way, that I can see some used fonts or other styles in the PDF source that can be changed intelligent with some regualr expressions?
MRi 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
HTML to epub displays munged source code haven Conversion 4 03-10-2011 10:08 PM
Options to show programming source code in ePub pedgarcia ePub 2 07-21-2010 10:41 AM
Best source formats to convert to epub? BrentB Calibre 12 03-05-2010 11:36 PM
PRS-600 Joined source code lines in pdf ldwedari Sony Reader 2 09-14-2009 04:03 AM
PRS-500 Code to Convert PDF to Images letkemanp Sony Reader Dev Corner 2 04-19-2007 04:25 PM


All times are GMT -4. The time now is 04:54 PM.


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