Best format for News Stand App content distribution - newsstand-kit

I am creating a News Stand application, I am just confused on which format to select: PDF or ePub or HTML5.
I am more inclined to HTML5 - are there any good samples on how to package an issue with HTML5 for distribution as issues in my News Stand app (I believe for HTML5 - I just need to load the Index/ToC page in WebView that way the rest pages are rendered automatically from the HTMLs itself).
Looking forward to your suggestions and advice.

Related

Does ePub restrict HTML to only some subset?

I was thinking about creating an ePub reader. All the ePub files I have seen so far seemed very simple: just text paragraphs with some big font for the title, and some rectangular illustration images. So, I thought ePub provides only simple ways to describe the text content.
But it seems that an ePub file contains lots HTML and CSS. I opened a sample ePub and it contained text in <p> with the class attribute. Does it mean that it can basically be like a website archive? The author can use any advanced formatting/layout feature that are used when creating an HTML website? If so, I would have to implement a whole web browser to create an ePub reader.
Or, is the HTML allowed in ePub are somehow restricted to only certain HTML tags and attributes, like the HTML that is allowed when writing on an online forum.
PS: I did some research on my own after posting this, and my conclusion is that it is the former. I have tried some famous ePub apps on the Android market, and they all seem to be weird in terms of GUI (meaning, probably non-native),and whilst there does not seem to be a definitive way to know whether an app is native or a web-app, one trick was enabling the layout boundary, and those apps do not have boundaries inside the ePub view itself, meaningly it probably is a web-view.
I searched GitHub for ePub viewers, and they all seem to be using JavaScript or a web-view, including this Android ePub viewer.
So, probably those ePub apps are just parsing the meta data files in the ePub format, and for the rendering of the book itself, they are just delegating that to the web-view and using some sort of JavaScript framework to add a UI on the web-view.
If someone knows better, please correct me.
My understanding of previous ePub specs is that it is a web archive of sorts. A compressed archive consisting of metadata, fonts, images, and content.
It used to be that this content was only in a specially-flavored XHTML format, but it looks like they've also added SVG content documents. I've admittedly lost track of the ePub spec changes (I didn't realize they had merged efforts with the W3C), but hopefully the spec links above can give an idea of what's different between a standard html5 web page and what epub expects.
EDIT: I should also mention that a lot of the readers I worked with back in the day had the bad habit of stripping out formatting and just presenting text (not even text with embedded fonts -- a big no-no for non-English texts). Not sure if this was the reader software being "robust" and acting against ePub formatting that would break their app, or something else.

iOS create PDF invoice

I want to create a PDF invoice inside my iOS App (either in Objective-C or Swift).
My main problem is that the invoice might have several pages, which is very difficult to realize with the existing APIs from Apple (CoreGraphics, Quartz 2D, etc).
By now, I already have a barely working solution:
I created a HTML template which is the basic structure for the invoice
The template is filled with data using GRMustache
I load the generated HTML file into a UIWebView and save it as PDF (I used NDHTMLtoPDF to do this)
So far, so good.
The problem with this solution is that page breaks don't work properly.
There are some tables and images and the page break often cut's off tables or images.
I have tried to use the page-break-inside: avoid; css property for the images and the tables but UIWebView seems to ignore them completely...
My question is:
Do you know how to fix the page break problem?
Can you recommend another solution to create PDFs on iOS?
Should I design the invoice in Storyboard and generate a PDF from the UIView? What about the page breaks here?
I would prefer to have a template (e.g. HTML), fill it with data and save it as PDF, rather than doing everything in code.
I actually wrote a PDF reporting component myself with presumably similar requirements:
templating is done via HTML / CSS
Static Header / Footer on each page
You can achieve this with UIPrintPageRenderer and UIViewPrintFormatter APIs, with the downside of probably getting your app rejected in the app store review, since you're using private Apple APIs. So this approach might only be viable in an academic setting or if your developing in-house apps.
There are some tutorials on how to do this which I'm not going to repeat, but for me these resources were quite useful:
http://www.fromdev.com/2014/06/how-to-create-a4-size-pdf-file-in-ios.html
http://www.labs.saachitech.com/2012/10/23/pdf-generation-using-uiprintpagerenderer/

PDF4NET pdf's not showing the bound content when viewed on iOS default pdf reader

I am using Version 4.4.1.0 of O2S.Components.PDF4NET
I am using this in an MVC project to run through a series of 6 views and fill an object with the data required for the PDF.
When the PDF is bound and emailed in the last step it works great. all except for when it is viewed by default PDF reader on iOS devices.
My company purchased this product on the cheaper plan so the 90 support is over and I cannot access any sort of forums from there site.
I read a similar issue regarding a button not being displayed on iOS but there was no resolution other then to email the company.
I hope that there is a viable solution as I would prefer not to have to cut my losses and change to a different product over something as short sighted as not supporting/testing against one of the more common platforms people use to consume media.
I'm not sure what you mean by 'bound content' but I assume you are talking about form fields.
Forms fields and annotations are not displayed by the CGPDF API in iOS, only the main page content is displayed. It is not a limitation of PDF4NET, it is a limitation of the iOS PDF display engine. The workaround is to flatten the form fields thus making them part of the page content.
If this is not your situation, please send a mail to support and they will help you.
Disclaimer: I work for the company that develops PDF4NET.

How to implement an interactive PDF in iOS

Here im hitting my head againt the wall.
My client provided a pdf with buttons(just like buttons,when user tap on button,it will load next page and previous page etc.).
This buttons will work only when we open it in adobe reader.
I tried the QLpreviewview,quickview but it is not working,all what i can do is just to load the pdf in the webview.
Can anyone please help me in how to load an interactive pdf in iOS.
Thanks in advance.
Have a look at PSPDFKit, it is the most advanced framework I've found for PDFs in iOS. They have an impressive list of customers as well.
It is a bit pricy though, but you have the option to get the Source Code too if you need to modify anything. Could be worth it if your client need that kind of performance and other features as well.
(I am not in any way affiliated with PSPDFKit)
The limitations are due to the capabilities (or non-capabilities) of the PDF viewer used.
Currently the leading PDF viewer on iDevices is PDFExpert by Readdle. Adobe Reader for iDevices is weaker, but can deal to some extent with form elements.
For page navigation etc. you might use links instead of button fields (as far as you can live with the capabilities of links, and not use JavaScript). Links are said to be handled properly with many PDF viewers.
You may have to require certain PDF viewers on instructional level, because you don't have control over the viewer used by the actual user. And, as you noticed, many PDF viewers are simply too dumb do deal with active elements.
Another approach would be looking at PDF-to-HTML5 converters, and serve HTML5 from a server.

Alternative to UIWebView for showing formatted posts

Well I found many discussions in google that UIWebView is bad. I'm trying to create a ios app that will show forum (bulletin board) topic/posts. Safari is slow showing them so i was planing to use ATOM feed to show the topics in a native ios app. Now the thing is, in ATOM feed, the posts are in html. showing them in a webview is same as browsing the site with mobile safari(even worst bcz of absence of nitro engine). So i think i should convert/parse the html and then show them using core text.
Will that be fast ? and should i convert/parse the html inside the app or use server side parsing ? if i parse inside the app, will that be laggy ?
Is there any library available that renders html using core text ? my html will be fairly simple, just bold italic underline and sometimes image. (font size is same all the time)
Have a look at Coconetics' DTCoreText. I have not used it personally but I thing it does exactly what you are looking for.

Resources