How to create PDF file and display as per our design.
customize PDF layout and add image and table create in PDF file.
i have send image this type i want to create pdf file .
Here is plugin called pdfmake. It will help you to create pdf of images. You can customise many of things for creating pdf like page size, table, fonts etc.
Following are some of the tutorial which will help you to guide :
https://medium.com/#rakeshuce1990/ionic-how-to-create-pdf-file-with-pdfmake-step-by-step-75b25aa541a4
https://ionicacademy.com/create-pdf-files-ionic-pdfmake/
I have used it in my project to creating pdf of images and working properly, so may it will help you.
I have a multipage pdf (~14 pages) that I want to load into a UIWebView.
Trouble is that when I activate scalesPageToFit
- The first page is zoomed to ~50%
- The page is centered
- I cannot manually move/scroll the page closer to the page-boundaries
Am using Interface builder.
Any ideas how I can solve this mystery?
Thanks
Try Apple's QuickLook for better PDF display.
Check out this example code: https://github.com/steipete/PSPDFKit-Demo/blob/master/Examples/PSPDFKitExample/PSPDFQuickLookViewController.m
(It's part of http://PSPDFKit.com)
I am working on an app and I need to save the content of UIWebView.
I currently Use stringByEvaluatingJavaScriptFromString:#"document.getElementsByTagName('html')[0].innerHTML"
to get the html of the UIWebView, but the problem with this method is that it does not save the full content of some webpages.
So my question is How do you save the full content of a webpage including images and css
I think there is already a thread about this topic here:
iphone uiwebview download complete page with CSS and Images
Hope that helps.
I am looking for a way to programmatically (in obj-c) generate a PDF file from a local html file. I am dynamically generating the html from user inputs, I need to create the PDF and send it to the user (via email). I am having difficulty with the PDF generation portion.
I have the code to create a PDF using CGPDFContextCreateWithURL but I am struggling with drawing the page using quartz.
I have searched extensively on SO as well as the internet to no avail.
Any help is much appreciated!
To generate a pdf from an HTML, you need to render the html into a web view, and take snapshots of the web view, and render them into an image context.
The tutorial might be helpful:
http://www.ioslearner.com/convert-html-uiwebview-pdf-iphone-ipad/
I've written a little piece of code that takes an NSAttributedString from DTCoreText, and renders it into a paged PDF file. You can find it on my GitHub Repository. It won't render images or complex html, but it should serve for most uses. Plus, if you're familiar with CoreText, you can extend my PDF frame setter to generate these items.
So what it does now: Give it an HTML string, and it will use DTCoreText to generate an NSAttributedString, then render that into a PDF. It hands back the location that it saved the PDF file in the app's Documents folder.
Why not use a WebService, send the HTML page to this and retrieve the PDF-file ?
That way you can use iTextSharp and C#, and you're done in about 2 minutes.
Plus (if you're evil) you can store and see all the data on your server.
I haven't tried this myself so i have nothing to offer concrete but I'd have to imagine there has to be an easy way to do this on iPhone due to the imaging model. I'd look deeper into the documentation.
As to pushing back with the client that is up to you but there are probably multiple reasons for wanting to keep everything local. Frankly I would not be pleased at all to here from somebody I hired that he couldn't manage this particular task. So think long and hard about this push back. Oh even if you do push back a webserver is a poor choice. I'd go back a step further and investgate why you need something in HTML in the first place.
I've never tried this so I have no idea if it'll work, but how about loading the HTML into a UIWebView, and then make the view draw itself into a PDF context? E.g.
UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(...)];
[webview loadHTMLString:html baseURL:...];
Then:
- (void)webViewDidFinishLoad:(UIWebView *)webview {
CGPDFContextRef pdfContext = CGPDFContextCreateWithURL(...);
[webview.layer drawInContext:pdfContext];
...
}
I made it by following this SO: https://stackoverflow.com/a/13342906/448717
In order to maintain the same content's proportions I had to multiply the size of the WKWebView 1.25 times the printableRect's size set for the UIPrinterRenderer, as the screen points differs from the PostScript's... I guess.
I am working a rss reader app for iphone . What are my options for displaying entry summary in rss feed ( which could be html) in a tableviewcell without compromising scroll performance .
I dont control the feed so html in summary section is out of my control .
I am thinking of uiwebview would be my last option ( so rss feeds have images and stuff in there, unfortunately ) . I was thinking if there was a way to extract summary text from html.
You can use a WebKit view, UIWebView to present the feed and add it a subview to the UITableViewCell.
You need to worry about the cell height and making the UIWebView non-scrollable.
I recently saw a presentation on Three20 (http://groups.google.com/group/three20/) that included a few things that might help you.
This is the specific thing I'm referring to: http://mattvague.com/three20-custom-cells-iphone-tutorial
If anyone is interested I just made a new up-to-date version of my custom cells tutorial, check it out at http://mattvague.com/three20-tttableitem-tutorial
Cheers!