Modify / edit PDF file

I want to edit the shown pdf.

I am currently creating one custom PDF page

CGPDFDocumentRef and CGPDFPageRef.

Now I will just add a transparent image to the entire current page . After the image has been added, I want to write it back to the same file .

But PDF can be multi paged .

My actual approach for this would be to show the PDF as normal CGPDFPageRef and display it.

I would use UIGraphicsBeginPDFContextToData to add this custom image.

Now I need to know how to get PDF data from unmodified pdf and insert it into UIGraphicsBeginPDFContextToData.

Then I would add this image to the context and write it to a file.

Am I still right, or should I do it another way.

Here is my current example code:

//find a solution to inject the current shown page / current pdf document as pdfData


UIGraphicsBeginPDFContextToData(pdfData, a4Page, nil); 


CGContextRef context = UIGraphicsGetCurrentContext();
UIGraphicsBeginPDFPage();

UIGraphicsEndPDFContext();

[pdfData writeToFile:newFilePath atomically:YES];
[fileMetaData release]; 

      

+1
ios objective-c pdf


source to share


No one has answered this question yet

Check out similar questions:

1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
1475
Converting HTML + CSS to PDF with PHP?
1115
Recommended way to embed PDF in HTML?
1111
Correct MIME Media Type for PDF Files
830
Combine / convert multiple PDF files into one PDF file
354
Fast and Fast PDF Viewer for iPhone / iPad / iOs - Tips and Tricks?
8
iOS - create multi-page PDF from HTML content
4
Modify existing PDF file in browser
0
Relying on rendered pdf - Swing
0
Add UIImage at the end of the PDF



All Articles
Loading...
X
Show
Funny
Dev
Pics