Draw something and copy it on a existing pdf document on iPad - ios

I want to make a simple drawing with finger and insert it in a existing pdf file. I don't know at all how begin this feature.
So,first step: make a drawing, second: edit a pdf file and insert the drawing,final: Save the document.
How can I start?
What libraries do you recommend me?
Thanks

For drawing you could use this library:
https://github.com/gtmtg/MGDrawingSlate
For creating a PDF i can recommend following this tutorial:
http://klanguedoc.hubpages.com/hub/iOS-Create-PDF-using-UIKit
Or you could just create some HTML and genarate a PDF from that using: https://github.com/ocrickard/OCPDFGen
For writing a file you can have a look at:
How to save/load text files in Objective-C for the iPhone, using UITextView?

Related

How to highlight text in pdf using PdfKit

I am creating app where i need to load the pdf file from document directory and need to highlight text manually by user.
Also we need to export the updated pdf file and upload it to the server.
Is there any way to manage the same using pdfkit ?
Please share the sample code if available.
We are using the library as a reference is listed below
https://github.com/uxmstudio/UXMPDFKit
This library is using the same concept as we need but exporting the pdf is the main task we need to achieve.
In simple word we can say that user can highlight some text from the displayed pdf text and upload it to the server.

PDF add stamp annotation from image

I have very specific task in Delphi 2010 with PDF. After some days fight I want to ask your help.
Task:
open pdf in embedded viewer component on a form
define a rectangle with mouse on the document
add into the rectangle stamp annotation from image file (BMP or PNG or JPG). The image must be stretched to the selected rect.
I try to use next components:
Acrobat Reader ActiveX (TAcroPDF)
Gnostice PDF Toolkit
Debenu PDF library
At the moment I have crazy mix of problems.
Acrobat can show PDF and can show annotations but has a methods to select a rectangle and to add a stamp from an image file.
Gnostice can show PDF, can select a rectangle BUT can not add annotation from image file and can not read all new 1.7 PDF files.
Debenu has no viewer but can read all files, can add a stamp fro image file.
Now I have almoust working solution with using all 3 libraries (each for own part of the task).
But some times acrobat library (or any other) raises exception like "can not save file" and other ones. I killed all concurence for processed PDF file (at one moment only one component exists, all other is destroyed).
The main question is not to help to kill the exceptions... But show me a way or library to solve the task. Maybe exist a PDF library for Delphi which I do not know... and this wonderful library can solve the task.
Thanks.
I would suggest not using TAcroPDF all together.
please see this post: TAcroPDF loses resolution after form has resized.
furthermore:
Debenu PDF library can render, modify and save PDF files as an Image - if you simply just have to show the user a preview - using debenu - create a temporary image file and show it in a TImage - Then use the rest of the Library to save the actual .PDF or do whatever you need to.

XML SDK 2.0 - Images - Excel file

With the use of the Open XML SDK 2.0, I did preformed the Reflected Code of an Excel file.
Along with other things, the Excel file has some images in some of the cells. When I run the code that was generated, the file show the images just fine.
What I need to do is to programatically inject images in place of the
images that are there now. The thing is, I cannot find where the images are at in the code that was generated. How can I figure this out? Also what is the easiest way to replace those images with new ones programmatically?
You may want to take a look at a similar question about inserting images into Excel files with OpenXML SDK: C# & OpenXML: Insert an image into an excel document.
Basically, those files are created as separate document parts. The answer I linked to should show You how to insert a new image into a document, however, in order to substitute existing images with your custom ones, you could probably just modify the binary data of appropriate ImagePart (and some other associated properties).
If You need some help with the code performing this task, let me know.

PDF generation in XCode

I am a newbie in iPhone development. I am planning to do a PDF application for iPhone. The functionality is:
User will type their input in a text field (which is going to be the content of the PDF file).
I have to modify the PDF file through code while saving (paragraphs, tables, bullets etc).
User can save it in their own name.
User can send the PDF file as attachment of MFMailComposer.
So I have searched and got many links. However I didn't find any leading details to create and modify a PDF file in iPhone/iPad.
Can anyone please provide me a good reference to do this. Are there any alternatives to do this?
I've used this reference: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
It contains theoretical explanations and source code examples
Please use the below link to download sample apps for PDF Reader/Viewer in iOS
PDF Reader/Viewer in iOS
Also please look at detail about pdf creation, manipulation etc in below links
developer.apple: PDF Document Creation, Viewing, and Transforming
Fast-and-lean-pdf-viewer-for-iphone
If you were doing a Phonegap app I'd say got for jsPDF, which would enable you to create (basic) PDF files in Javascript. I don't do Obj-C, but a quick look on SO provides good links.

Add PDF page in iOS

I have an algorithm to create a PDF file, but I want just to add one pdf page at the end of existing pdf. Do any one has idea about that?
Here is a solution for merging pdf but using an other library:
Merge PDF files on iOS
May be you can read the old pdf file,and recontruct a new pdf file.I think.
Up till now it's not possible to reopen and continue editing a PDF file . Only redraw whole PDf again .

Resources