I am using pdf.js on(https://github.com/mozilla/pdf.js). I am able to use examples(hello world and acroforms) in gwt using JSNI. Pdf show properly now i want to use viewer.js in gwt so i convert full code in jsni. i am properly using html and css files after that no error show put still pdf also not show.
if any idea plz suggest me. Thanx in advance.
How can I add annotation to an existing pdf file? I saw libHaru library.But it doesn't allow editing existing file. How can i overcome it?
After running into this issue recently, I had to piece together a few ideas to make it work.
A few questions:
What type of annotation are you doing?
Do you have a png file of the pdf?
What are you doing with the file after it is appended?
Hi-level:
Convert pdf to image file either programmatically or before adding to the bundle.
Have appending done and saved on another layer of the view (OpenGL as an example).
Merge/Combine the two image layers.
Draw new combined image pdf.
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 have A4 size PDF page. PDF page contains 10 images. I want to split the PDF page as 10 image files. Plz give me an Idea.
You can use PDFBox (a library available for .NET) to convert each page of the PDF to a PNG image, then use the GDI functions in C# to copy known regions of the PNG files and save them as individual image files. This only works if the layout of the images on each page is static.
More info on PDFBox:
http://studentclub.ro/lucians_weblog/archive/2007/03/22/read-from-a-pdf-file-using-c.aspx
PDFsharp seems to be a popular open source choice for PDF manipulation from .NET and Mono. PdfMod is a related Mono-based front-end.
I would like to create an application that downloads a PDF document from the Internet, and displays it to the user. I would like to re-use the iPhone's builtin PDF viewer that is used throughout the core apps to view a PDF document.
Is there a way to do that?
You could just use UIWebView class to do that.
Try this: https://github.com/vfr/Reader