About
Meet Sorin Nistor
I work as a senior software developer for O2 Solutions, a software company that develops PDF tools and components for Microsoft .NET framework. I have been involved from the start in the development of the main company products, PDF4NET - a .NET library for creating and editing PDF files and PDFView4NET - a .NET toolkit for displaying and printing PDF files.
I've been working with PDF files for 9 years, the PDF specification is my professional bible π
During the last months I started to investigate the PDF capabilities of the iOS platform, and while the available PDF API is pretty rich, it requires quite a good knowledge of PDF specification in order to take full advantage of it.
This blog wants to bring together the iOS PDF API and the PDF specification by presenting solutions to specific problems iOS developers encounter when working with PDF files.
Let me know if it succeeds.
You can contact me by posting a comment below or by email at ipdfdev [at] ipdfdev [dot] com.
Licensing information
Code samples quoted on each blog page and linked projects may be used in accordance with the following "zlib"-style license:
Copyright (c) 2011 Sorin Nistor. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. |
This permission only applies to the code samples and code in the downloadable projects. The prose and artwork assets of this blog and its downloadable content may not be reproduced without prior consent.
May 18th, 2012 - 21:12
Hello Sorin,
I manage an iPad HTML/PDF “viewer” application for my company and am investigating the availability of APIs/SDKs that will allow for the addition of a PDF annotation capability. Can you suggest any products?
Thanks,
Shawn
May 19th, 2012 - 10:19
I assume you developed the viewer using the CGPDF API. The problem with this approach it that at some moment in time you’ll have the PDF file loaded twice in memory, once in your viewer and once in the other library where you annotate the file. With large files there might be memory problems. It is a pity that Apple does not support PDF modification using the CGPDF API. Regarding annotations there is libharu but I’m not sure it can load existing PDF files. There are also the toolkits from Foxit and PDFTron, but they can be pretty expensive. I’m working myself on an Objective-C library for editing PDF files on iOS but it will be ready only during September.
August 23rd, 2012 - 08:57
Hi there,
I love all the work you have done with PDF’s. I was wondering if you could help me. Please keep in mind I have a basic knowledge of xcode just from exploring. I am a teacher and would love for my students to present certain aspects of their work they create in .doc .pdf .xls in xcode. Do you have any projects which use .xib or storyboards that would make it easy for my students (who are 12yo) to create their own backgrounds, colour, and simple buttons that link to PDFs, DOC and XLS? Any help would be much appreciated.
Something along the lines of a front page that consists of buttons which link to certain files with extensions pdf doc and xls. Ive tried using your revised zoomingpdf project and uiwebview but not sure how to load more than one file in the uiwebview.
Thank you again for your tutorials and source codes.
Sincerely,
Vincent
August 24th, 2012 - 09:11
Sorry Vincent but I do not have such sample projects.
November 10th, 2012 - 16:10
Is the library available (iOS SKD)? Does it support form fields? I need to generate a pdf with form fields that can be manipulated (i.e. data in them edited).
November 12th, 2012 - 16:58
The library is not available, it is just at the beginning. In the end it will support form fields (add/remove form fields and fill the fields) but at this moment I do not know when this feature will be available.
December 15th, 2012 - 01:32
I am trying to extract images from a pdf using your example code, and cannot find where PDFContentStreamProcessor and PDFGraphicsState is declared. My pdf has many pages, each page is a single full (page) size image.
December 17th, 2012 - 17:26
These classes are defined by me and they are included in the sample project, download link available at the end of the article.
February 17th, 2013 - 01:05
Hey iPDFdev,
Love your blog and the various articles you have here that allow people to get educated with PDF products.
I was wondering if you knew about the PDF product that is available on Binpress?
http://www.binpress.com/app/pdftouch-sdk-for-ios/859
February 17th, 2013 - 17:56
Yes, I saw it a week ago.
September 10th, 2013 - 23:23
Hi Sorin,
Congrats on this awesome work. Very informative.
Since a long while I have been looking for a PDF framework for ios which supports RTL paging and Arabic search.
Despite on what they claim I was never able to find a reliable one.
Out of your experience and expertise, could you indicate me one or more good options.
Thanks.
September 12th, 2013 - 11:23
Unfortunately at this moment I can recommend none.
February 4th, 2014 - 04:08
Does it support CCITT G4 compression? I would like to import CCITT G4 images into a PDF.
Let me know
Thanks
David
February 4th, 2014 - 16:52
CCITT G4 compression is under development. At this moment only the images that can be loaded in a CGImage can be drawn into a PDF.
February 4th, 2014 - 19:29
RIght now to get the TIFF we are doing something like this:
CFDataRef tiffFaxG4DataForCGImage(CGImageRef cgImage) {
NSBitmapImageRep *imageRep =
[[[NSBitmapImageRep alloc] initWithCGImage:cgImage] autorelease];
NSData *tiffData =
[imageRep TIFFRepresentationUsingCompression:NSTIFFCompressionCCITTFAX4
factor:0.0f];
return (CFDataRef) tiffData;
}
Let me know when you are getting close
Thanks
February 4th, 2014 - 19:30
NSBitmapImageRep claims to be able to generate a CCITT FAX Group 4 compressed TIFF
February 5th, 2014 - 15:03
Yes, but what I have to do is to decode the tiff image, get the image data, re-encode it using CCITT G4 and put it in the PDF. Simply taking the CCITT G4 data from the TIFF and put it in the PDF does not always work.
February 27th, 2014 - 17:46
Hello
I would like to know if with this framework I can open an existing PDF and add something like a jpg image (tipically a stamp or a note). Thanks
February 28th, 2014 - 10:10
This feature will be available in about 2 months. I’m working on parsing PDF files and when this feature will be implemented you will be able to load a PDF file and add new content (vector graphics, text, images, annotations, etc) to it.
April 13th, 2014 - 23:48
Hi Surin, thanks for demystifying a little bit the PDF internals and make it become so accessible. I had a look at the sample code. Very nice! I am working on a PDF Annotator on Mac OS X. It might be similar to what you are working on as per your message of Feb 28th except that I do not touch the PDF Stream itself, but on only draw additional graphics myself. The additional graphics can be drawn before page rendering in which case it goes to the background or after the rendering so it be superimposed on the foreground.
I realized that some PDF documents have an opaque white background on each page, specially those created using -[NSView dataWithPDFInsideRect]. So that those of my graphics in the background becomes hidden. I need a way to detect when the PDF stream contains this white page background color in order to move all my graphics in the foreground. Can this white background be detected as an image or which operator do I need to implement for that?
Thank you vera much!
Serge.
May 16th, 2014 - 13:06
This white background can be created in many ways (an image, a rectangle, etc), it is not some standard object in PDF. It is not something that can be reliably detected and removed.
July 1st, 2014 - 16:23
Hi Sorin,
Is it possible to edit an existing PDF with your framework? If yes, could you send me an example please?
Thank you very much
Stefano
July 1st, 2014 - 18:14
What kind of edit operations do you want to execute?
July 2nd, 2014 - 11:19
I would like to load a PDF and add images or photos, write with finger and keyboard, underline and highlight.
thanks
July 2nd, 2014 - 13:05
For this task you’ll need a PDF viewer framework and my framework cannot help you in this area.
July 2nd, 2014 - 15:16
I was wrong to express, I would like to do the same tasks that are done in creation but programmatically in an existing PDF.
Sorry
July 2nd, 2014 - 18:10
Yes, this will be possible. I’m working to support PDF loading and after this is implemented it will be possible to add new content to existing PDF files.
November 12th, 2014 - 17:14
Your sample is not working in Xcode 6.1, do you have any working sample?
clang: error: linker command failed with exit code 1 (use -v to see invocation)
November 13th, 2014 - 09:43
What sample are you referring to?
December 11th, 2014 - 10:06
Hi Sorin,
Where can i find the framework for OSX ?
Would like to do dome testing .
Regards,
Peter
December 11th, 2014 - 12:14
I’ll send it to you by email.
March 25th, 2016 - 22:01
Hello Sir,
I am interested in this for OSX platform, would like to offer myself for testing,
Just developed scanner application with pdfkit for viewing, was looking for OSX PDF framework that would support these two things (form fields just like mail merge MS in word) once we run auto form fill fields, give the user option to edit the pdf text.
If you could send me the kit by email, and some instruction will integrate in my application, and test it out.
Thanks,
Vijay Meganathan
February 6th, 2015 - 01:55
Hi Sorin,
I stumbled upon your framework and I am impressed by the functionality. Also it seems to have the most convenient API of all PDF creation frameworks available.
Is it possible with your framework to draw an image with a specified color space (e.g. ICC)? Or would I need to do the color space conversion myself before drawing it?
Or more generally asking, how are colorspaces of images handled in the PDF specs?
Will this framework be updated? I noticed that the framework does not contain a slice for arm64 architectures yet.
February 6th, 2015 - 11:23
At this moment I’m using the CoreGraphics API to decode the images and the image data is always embedded as RGB. In the future I’ll add support for creating images with custom color spaces.
Right now I’m restarting the development, I’m working to support 64bit and ARC.
February 6th, 2015 - 12:58
Thanks for this info! I appreciate it.
Great to hear that you’re working 64bit support.
Do I assume correctly, that it is not possible to embed images with custom color spaces with the CoreGraphics API alone?
May I ask if you can already tell when 64bit support and support for custom color spaces will come?
February 6th, 2015 - 17:13
64bit support will be available this month. Custom colorspaces for images is a little bit more complicated. You can send me an email for more details.
March 3rd, 2015 - 06:25
Hi, Sorin
We are working an mobile App which requires following functions:
1. Load existed pdf from server to ipad (or iphone)
2. edit the pdf (usually just filling in the form, adding image to the pdf etc.)
3. save the filling data into the server. (database)
can you please let me know if your sdk can finish above function?
thank you so much.
John
March 3rd, 2015 - 13:49
This functionality is not supported in IFXPDFFactory.
April 9th, 2015 - 04:39
Hi,
I am interested in the IFXPDFFactory.
From the demo project, I found it just create the pdf file from an empty page and then add some annotation. Is it able load an existing pdf file?
Thanks.
April 9th, 2015 - 11:21
Indeed at this moment only PDF creation is supported. I’m working on PDF loading and this feature will be available by the end of June.
May 7th, 2015 - 12:19
Hi,
I am interested in purchasing a license of the IFXPDFFactory.
Can it create a PDF from a view controller?
Can it create a PDF from HTML?
I found it very awkward to create PDFs the Apple iOS built-in way…
Thanks.
May 7th, 2015 - 12:45
I’m not sure what you mean by ‘create a PDF from a view controller’.
HTML to PDF conversion is not supported.
May 7th, 2015 - 12:58
What I mean is an easy way to create a PDF from that what the user sees of my app in his iPad.
Let’s say the app is a calculator for financial loans. So the user fills out a couple of screens/view controllers and from that information a loan proposal is calculated. The calculated loan and all the user input is finally presented to the user in a view controller.
I am looking for simple way to print that out/save it to a PDF file, without me having to create that what is basically a with data populated storyboard.
May 7th, 2015 - 13:09
For this scenario the best solution would be a predefined PDF form in which you fill only the variable values (loan, user input). At this moment I do not support this scenario.
May 7th, 2015 - 13:12
Do you know any library that supports that?
Or, if I would create HTML for the result, does your library support generation of a PDF from HTML in iOS?
May 7th, 2015 - 13:20
It is possible that PoDoFo supports form filling. For HTML to PDF conversion on iOS there are a few projects on Github: https://github.com/iclems/iOS-htmltopdf, https://github.com/brentnycum/BNHtmlPdfKit
May 7th, 2015 - 15:58
tx
September 26th, 2015 - 20:41
Hi Sorin-
I’m considering a license and was wondering if you had finished the ability to insert an existing PDF into a document. I was also wondering if there is a way to use attributed text.
Thanks for the work- looking forward to hearing back.
September 28th, 2015 - 13:21
Unfortunately I have not finished yet this feature. I had to take a break from this project and I hope to start working again soon.
September 28th, 2015 - 01:46
Hello again Sorin-
I’m looking at your sample code and getting memory leaks with Instruments- I am very interested in purchasing a license, however I’m curious about the leaks and my previous questions.
Can you let me know?
Thanks
September 28th, 2015 - 13:23
The library is kind of alpha stage, there are stil memory leaks. I should resume working on the library after October 15 and then I’ll fix the memory leaks.
September 28th, 2015 - 22:39
Thanks for the reply-
With the current state of the library, how much would a license be? I’m wanting to try it out for an in-house app.
September 29th, 2015 - 09:32
These are the prices: http://ipdfdev.com/ifxpdffactory-purchase/
For the current state there is no partial price. The library at this moment has no limitation, you can ty it in your application and I’ll provide you with support if you need it. You can purchase the license when v1.0 will be released.
September 30th, 2015 - 00:20
Thanks Sorin- I will watch here for the 1.0 release. Thanks for the work.
February 6th, 2016 - 07:16
Hello,
I user your code for convert image to pdf. Its woking fine for single page pdf. But i need to create multiple page pdf from array of image. Can you please give me solution for it.
Thanks in advance…..
April 5th, 2016 - 15:37
I Don’t get proper answer for my question can you please give me answer. I need your help. Please help me.
January 12th, 2017 - 18:49
Hi! I am interested in an ios app that utilizes your code. Specifically, PDF optional content toggling. Do you know of one?
I need to be able to toggle on/off different layers on top of a floorplan drawing. Any info is appreciated!
Thanks,
Grant
January 13th, 2017 - 10:10
Sorry, I do not know any app. The code is in early stages of development, there is no app to use it.