I am new to the iOS development and am developing document based iPad appliactio. So,
Is there any way to convert the epub document to pdf document in iOS. Please let me know.
Thanks
Mahesh
I personally don't think that iOS have some tools to do that. Best choice will be upload your document to some unix server and then convert it with pandoc for instance. But be aware that this type of conversion is poor quality fo 99% of documents.
Seconding pandoc (for which you'll want an OS X, Linux, or Windows system), though I'm here looking for the solution.
Some tips though:
An EPUB document is a structured format contained within a ZIP file. Unpack that and you'll get the document in HTML format, plus images, plus structure information.
Pandoc is a very nifty converter that will take single documents and convert between many, many file formats, including markdown, HTML, LaTeX, PDF, and ePub. It won't read from ePub natively, though it seems to me that if you can parse the package.opf file you should be able to reconstruct the document in the form you prefer.
My general thought is to create LaTeX source from the HTML documents, and use that to produce PDF (or other) outputs. I'm seeking tips on simplifying and automating this, will follow up if I find more.
Related
dear experts: we would like to publish a magazine in epub format, so that it can be read on iPads. (our creation system is now multimarkdown -> specialized post-processor -> calibre .) the problem is that our magazine needs math. this is not a problem on the epub viewer in ubuntu, as invoked by calibre. it invokes mathjax just fine. however, transfering the epub to a (net-connected) ipad (open in ibook) does not execute mathjax to display the equation. eventually, I also want this to work in android tablets, but for now, ipads are our only target. (iphones are too small for us, anyway.)
I do not want to graphically render the content, because I have never seen this look nice.
is there any way to create an ebook with mathjax for an ipad? the best choice would be if there were a way to get ibooks to execute javascript? if not, is there a tool that makes an app with ebook-reader-like functionality from html5 (incl javascript)? (does the javascript need to be local, or can it be web-connected?) if not, then what?
sincerely, /iaw
You can use MathJax in iBooks if you include a (slimmed down) MathJax installation within the ebook itself. This is not a great solution, but it can be made to work. See this article for some tips on how to do it. It is a little out of date, but I think it should still work.
In terms of preprocessing, which I know you don't want to do, you could use MathJax to generate SVG versions of the mathematics, which look pretty good on iOS, and should render on other platforms as well, so that might be a viable option for you.
I have posted a short script in
https://tex.stackexchange.com/questions/154644/eqnarray-math-to-svg?noredirect=1#comment353540_154644
that is a start for converting inline mathjax into inline svg. this should work in any epub and remove the mathjax dependency. it still has baseline problems, but it's a start. it rescales. hopefully someone else will pick it up and make it more robust.
I've written an ePub generator by using ZipArchive in .NET and looking at the spec (in Wikipedia) & a example.
It doesn't work! But I only get a generic error so I'm unable to fix anything from here.
Where could I go to upload my ePub and be told what is wrong with it? Or is there a tool that is better for it? I'm currently using Adobe ePub reader...
I realize this is an old question, but in case others come across this I wanted to contribute. The IDPF which is responsible for the ePub standard has a tool for checking ePubs called epubcheck. It can be found at https://github.com/IDPF/epubcheck.
In addition, they have their own online validator that uses epubcheck. It is located at http://validator.idpf.org/
I found an online validator tool at http://www.epubconversion.com/ePub-validator-iBook.jsp.
There are two basic black box approaches.
First: Generate a file and put it into a validator.
Second: Take a set of in- and output without using your code (other generator, example, do it manual). Then use a file comparison tool (maybe extract zip first).
Here is a good offline checking tool for Windows, Mac or Linux OS:
http://www.pagina-online.de/produkte/epub-checker/
It's a great tool which even i used to validate and generate epub files also clearly give errors if any.
When I was learning Portable Executable (PE) file format for windows, tools like PE-Explorer and PEView helped me in learning things quickly and nicely. Now, I need to learn and understand the apple quick time file format. Are there any
Tools with which I can browse the quick time format?
Export sections of the file?
Any additional resources other than the specifications?
PS: I'm on windows and I don't have mac/macOS
Tools with which I can browse the quick time format?
On Windows you can use MP4 Explorer, and since it is open source you can also learn from it. Since MP4 uses a similar structure to QuickTime you can use it for both.
There is also the old Dumpster tool from Apple. There is an old version of this tool for Windows, but I could not find it in the Apple developer site. This forum post has a copy that you can try. This is very old though, I'm not sure if it'll work with recent QT files.
If you can obtain access to a Mac running OS X, then you can use Dumpster or Atom Explorer.
Export sections of the file?
I don't know of any public tool for this. Your best bet is to extend MP4 Explorer to do this, or write your own parser. Parsing the atoms is actually pretty simple, things start to get complicated when you need to interpret the content of the atoms and cross-reference them to, for example, locate where the frame data is.
Any additional resources other than the specifications?
The QuickTime file format specification is the best resource for Apple generated QuickTime files, but you may need to do some reverse engineering, as the spec is not very complete in some areas, like the handling of MPEG-2 and MPEG-4 video. If you have access to ISO specs, then ISO/IEC 14496-12 is a standardized version of the QuickTime format (or better said, of a subset of it). The ISO/IEC 14496-15 specification builds on top of 14496-12 and defines a specific implementation of this format for the H.264 format. This is the so called MP4 format.
With the above three documents you should be pretty good in terms of documentation.
The MPEG4 (.MP4) file format is based on the QuickTime file format. You should be able to use the MPEG4IP tools to examine .MOV files. You can find windows binaries here.
Media Box Viewer does exactly this and much more. In addition to Quicktime, it can also open mp4, 3gp, etc. It runs on all platforms, Windows, Mac, Linux, etc.
It can be downloaded from www.jdxsoftware.org.
I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.
If you know or use a PDF export filter which works with Fast Report, please let me know.
November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.
October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.
Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:
And on Windows:
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.
From my experience, here's what got me into trouble:
Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.
Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!
Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).
I opened that document on the following mobile devices:
iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.
About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:
Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.
AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).
Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.
It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.
See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.
The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.
The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.
Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.
In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.
Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.
After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.
Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html
I use wPDF from WPcubed components, it's really a great product, good value for money
You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.
We need to export a QuickReport so that it can be opened with the latest Excel 2010 in xlsx format. This link provides a solution. But it did not work for us.
Anyone have ideas?
UPDATE
The version we are using is QuickReports 5 - We just got it.
Clarification of "does not work". The filter allows the report to be saved with an xml extension. And inspecting the file it is valid xml data. But we also inspected a xlsx file. But it does not look the same.
Maybe a dumb question, but are you quite sure you need to do this? New versions of Excel can still open old-fashioned .XLS files.
As for the "XML" exporter you linked to "not working", I think you've misunderstood what it does. It writes an XML file suitable for use with Excel's XML importer. This is very different to an .XLSX format file,
You could try a third party product like Gnostice eDocEngine. It would allow you to export to .xls. If you were feeling particularly masochistic you could do some sort of COM automation to convert the report yourself (i.e. parse the report and fill in the appropriate cells in excel)