02-12-2009, 03:33 AM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2009
Device: eeePC 901
|
PDF formatting scripts for eee PC
Hi,
I'd like to contribute a couple of scripts that I'm using on my eee PC 901. They format text (plain, compressed text, rtf or html) files to pleasant to read PDF files. You can see the resulting pdf in the attached image. The scripts (written for bash and python) are in the attached archive text_formatter.tar.gz . The scripts are tested only under Ubuntu (8.04). You must have latex, dvipdfm, python, evince, bunzip2, unzip, unrtf, html2text and the standard gnu command line tools (gawk, sed etc... ) installed. (they all are packaged in the Ubuntu repository). You must copy the attached scripts somewhere along your path, for example /usr/local/bin . The scripts currently stupidly use the global /tmp directory, and are basically just a quick hack to get the job done. I'm hoping that someone finds these scripts useful, and can modify them for their own use. I don't have the time to give any kind of support for these scripts. However, if someone has a cool improvement or important bug fix, I'd like to hear about it. Best regards |
02-12-2009, 05:04 AM | #2 |
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Thanks a lot for the script, good idea !
I've tried it and I 've some differents results. The 1st line begin with "begindocument", the text on the right seems cut and the last line in the bottom seems cut too. I've tried with 'xterm_fax.txt'. I worked on Debian Etch 4r. and the Python's version is '2.4.4 '. |
Advert | |
|
02-12-2009, 05:43 AM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2009
Device: eeePC 901
|
Hi,
I'm not sure if I understood the problem. Do you have texlive-latex-extra installed? The scripts are meant for ebooks. tidy_text_mode.py tries (heuristically) to merge paragraph text to long lines, remove the possible hyphens from the ends of the lines and keep the dialog text in separate lines. format_book.sh then inserts double linebreaks so that latex will not merge everything into one giant paragraph. In all other ways, format_book.sh lets latex worry about the text formatting (which is something latex does very well). |
02-12-2009, 06:28 AM | #4 | |
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
I've the "texlive-latex-extra" package and test a more simple file, the A2PS's faq.
I found the following thing. 1 - In the begin of the tex file : Quote:
2 - The parser can't deals with some classics characters like CR,TAB when they 're writed "\n" or "\t". In the tex file they're interpreted like "n" and "t". I've remove some controls sequence used in the configuration of A2PS for have a [B]GOOD[\B] display. With a text file (a story), I think there is no problem. Happy to have our script |
|
02-12-2009, 07:05 AM | #5 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2009
Device: eeePC 901
|
Hi,
thanks for your report. It seems that the echo command behaves a bit differently between our systems. In my system, "\b" was interpreted as backspace, and I had to use double backslash "\\b" to prevent this. The following is probably more portable way to express the same thing. Option -E suppresses the parsing of escape sequences. /bin/echo -E "\begin{document}" >> "/tmp/$name.tex" best regards |
Advert | |
|
02-12-2009, 07:42 AM | #6 | ||
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Hi,
It's solve the problem for The last problem is the backslash in the file. In the A2PS's faq : Quote:
Quote:
|
||
02-12-2009, 10:03 AM | #7 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2009
Device: eeePC 901
|
ok, attached version should handle the special characters better. I forgot to mention that by editing the format_book.sh -script, you can get portrait mode or change the colors to white text on dark background. Unfortunately, the eeePC display is a bit harder to read in sideways orientation. Probably it has a TN panel.
If anybody else wants to try these scripts out, please use the latest version (currently 0.01). |
02-12-2009, 10:50 AM | #8 | ||||
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Sorry, It's me again Perfect for the standard text.
I've tried with a html file, from de /usr/share/doc, the "BeanShell". There is no output. Maybe I take a bad type of HTML file ... ? The characters are interpreted by Mobileread, the aspect is not like my local view. The begin of file : Quote:
Quote:
And the file /tmp/syntax.tex : Quote:
Quote:
Last edited by Randy11; 02-12-2009 at 10:53 AM. |
||||
02-12-2009, 11:43 AM | #9 |
Junior Member
Posts: 5
Karma: 10
Join Date: Feb 2009
Device: eeePC 901
|
ok, the fastest way forward would be if you could send the offending html file for me to perttu ddoott haimi aatt gmail ddoott com.
|
02-12-2009, 11:53 AM | #10 |
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Thanks. It's done.
|
02-19-2009, 06:19 PM | #11 |
Connoisseur
Posts: 54
Karma: 38
Join Date: Feb 2009
Device: HTC Magic
|
This is fantastic news, I run Ubuntu on a daily basis and actually have an Eee 901, plenty of txt books, and no eReader
As long as I can figure out how to tweak the colours, and possibly format the text to be single column (not for me, for my girlfriend who seems to prefer it that way), you may have just saved me a whole lot of trouble I'll report in when I've given it a go, and if I have any thoughts or troubles Thanks! |
02-19-2009, 07:09 PM | #12 | |
Connoisseur
Posts: 54
Karma: 38
Join Date: Feb 2009
Device: HTC Magic
|
SOLVED!
Alright, so I was missing a font. Pncr7t.tfm For future reference to anyone who needs to know, it's found in the texlive-fonts-recommended package, in the Ubuntu repositories. Script now appears to work perfectly, thank you again The now solved problem, below: Hurrum, so, I'm still a bit of a linux newbie when it comes to the inner workings. But, I managed to get the script from "Not working at all." to "Generating a completely blank pdf" Have installed latex, gawk, and the other things the script said were missing. And, I assume it's all there. For simplicity's sake, I have my desired txt file in the same directory as the script. However... am now running into this: Quote:
Is the problem, but I'm not sure what it means. Pncr7t appears to be a font, I installed a tex package with a font of the same name installed - but to no avail, so maybe I'm wrong. Tips? ;-) Last edited by tali3sin; 02-19-2009 at 07:19 PM. Reason: Solved the problem |
|
Tags |
eee pc, pdf conversion |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pdf formatting | Ron46 | Ectaco jetBook | 25 | 06-23-2010 09:46 AM |
Reader for PDF magazine, university scripts etc + ability to write notes / highlight | Czechnology | Which one should I buy? | 2 | 04-27-2010 03:30 PM |
Formatting PDF for Kindle | Kindle10 | Workshop | 3 | 12-26-2008 06:02 PM |
CLHP Iphone PDF works well with Asus Eee | wrjames | Alternative Devices | 1 | 08-11-2008 09:38 AM |
Fox Searchlight scripts available in PDF | jckatz | Reading Recommendations | 1 | 02-23-2008 11:39 PM |