![]() |
|
Aozora to PDF Converter - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Learning resources (http://forum.koohii.com/forum-9.html) +--- Thread: Aozora to PDF Converter (/thread-7607.html) |
Aozora to PDF Converter - Souryo - 2011-04-03 Edit: Original post is made rather irrelevant by : http://forum.koohii.com/showthread.php?pid=133528#pid133528 Which appears to be a much better alternative for aozora->PDF conversions :p Aozora to PDF Converter - nest0r - 2011-04-03 Looks very useful and well-timed, thank you. Hopefully you don't mind my linking this back over to cb4960's JNovel Formatter in case cb4960 will find the source useful for integrating the functionality, per this discussion: http://forum.koohii.com/showthread.php?pid=129055#pid129055 Edit: First thing I'm noticing, unfortunately, is that the program window is too small to show all of the options, and can't be resized? Hitting the bottom right button, which I can just see the top of and assume from the screenshot is the Generate PDF button, I'm getting an access denied message for the output path. I might try running it as administrator. Aozora to PDF Converter - wccrawford - 2011-04-03 I assure you that you didn't waste any time at all on this. This is an awesome utility and not something that I've seen before. I look forward to using it. Aozora to PDF Converter - Souryo - 2011-04-03 Somehow I knew you'd end up being the one to test it first, nest0r :p And that thread you linked is actually what originally gave me the idea of doing something like this, since I never managed to salvage anything useful from the ruby script on that page after trying for a couple of hours. I've most likely fixed the display issue you were having, new download is here: Aozora2PDF Bigger download since I had forgotten to include the ms mincho font in the first ZIP file. For the access error on output, I haven't been able to reproduce it. Best I get is trying to save directly in C:\, in which case windows tells me I don't have rights. But saving anywhere on my desktop seems to work just fine. Running as admin might fix your issue, so it's worth a try. Thanks for testing! Aozora to PDF Converter - cb4960 - 2011-04-03 I'm on Windows XP and I get the following exception: ************** Exception Text ************** iTextSharp.text.DocumentException: Font 'KozMinPro-Regular' with 'UniJIS-UCS2-V' is not recognized. at iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded, Boolean cached, Byte[] ttfAfm, Byte[] pfb, Boolean noThrow, Boolean forceRead) at iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded, Boolean cached, Byte[] ttfAfm, Byte[] pfb, Boolean noThrow) at iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded) at Aozora2PDF.frmAozora2PDF.CreateBook() at Aozora2PDF.frmAozora2PDF.btnGenerate_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Aozora to PDF Converter - nest0r - 2011-04-03 Yeah, I think I got the error because I stupidly just typed in the drive letter and assumed it would name the .pdf itself. ;p Hitting the browse button and typing out the name works. ^_^ New display works also. Time to test out the formatting conversion. Aozora to PDF Converter - Souryo - 2011-04-03 @cb - You just got the one exception I hoped nobody would ever get! Congratulations! :p My guess is that your computer doesn't have that font, or any equivalent. (This is probably the part of the program I am most in the dark about, myself..) To my knowledge I did not have the font installed (in the Windows fonts folder) when I started working on this, and it worked properly. So my guess would be a difference between Windows 7 & XP, or the fact I have the Japanese Language Font Pack for Acrobat 9.0 installed: this If you don't have that installed, it may be worth a try, since I've been able to find a KozMin variation somewhere in the Program Files\Adobe folders on my computer. @nest0r - Great, let me know how that turns out :p Aozora to PDF Converter - nest0r - 2011-04-03 A couple things I've noticed so far: Sometimes punctuation marks will occur by themselves in columns. It seems related to the overflow stuff? Because it's hard to select a period at the end of a sentence w/o dragging over to the left to an empty space at the top of the following column. Also, the 外字 thing. ;p Here's a section from this randomly selected (via Googling for the 外字 formatting) .txt: http://www.aozora.gr.jp/cards/001248/files/46518_ruby_25560.zip 昭和十年ごろの夏の一日であつた。瀬越、小野田、橋本、篠原、呉清源などの日本棋界の強豪と、報知新聞の生駒※[#「皐+羽」、第3水準1-90-35]翔並に私など、木更津の海へ簀巻の漁に行つたことがある。その日、漁が終つて潮が上げはじめると南の風が伴つて海が荒れ、浪に弱い生駒※[#「皐+羽」、第3水準1-90-35]翔は船酔ひを起して顔色蒼白となり、いかにも苦しさうであつた。その姿を見た呉清源は、なんと思つたか、ひよいと立つて※[#「皐+羽」、第3水準1-90-35]翔のうしろへ廻り、黙つてその肩へ飛びつき、指先しなやかに揉みはじめたのである。 Here's how it is displayed on the site: http://www.aozora.gr.jp/cards/001248/files/46518_25612.html 昭和十年ごろの夏の一日であつた。瀬越、小野田、橋本、篠原、呉清源などの日本棋界の強豪と、報知新聞の生駒 翔並に私など、木更津の海へ簀巻の漁に行つたことがある。その日、漁が終つて潮が上げはじめると南の風が伴つて海が荒れ、浪に弱い生駒 翔は船酔ひを起して顔色蒼白となり、いかにも苦しさうであつた。その姿を見た呉清源は、なんと思つたか、ひよいと立つて 翔のうしろへ廻り、黙つてその肩へ飛びつき、指先しなやかに揉みはじめたのである。Here is the result after conversion with your tool: 昭和十年ごろの夏の一日であつた。瀬越、小野田、橋本、篠原、呉清源などの日本棋界の強 豪と、報知新聞の生駒※翔のうしろへ廻り、黙つてその肩へ飛びつき、指先しなやかに揉みは じめたのである。 Everything from the first [#「皐+羽」 to the final 1-90-35] appears to be omitted. The a2k tool result is similar to the site's version, but with the text version rather than .png of the 外字. |