Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

schoeringhumer

macrumors newbie
Original poster
Sep 2, 2009
9
0
hiho,

i would like to add some content to my PDFPage.... it would just be an NSString, but i seem to be too silly for that ...

my code now looks like this:

myPDF = [[PDFDocument alloc] init];

PDFPage *page;

page = [[PDFPage alloc]init];

// here i want to add strings or whatever to my page ... but i don't know the name of the function(s) ... can anybody help me ?


[myPDF insertPage:page atIndex:0];

[page release];

[myPdfView setDocument:myPDF];
 

`lowell`

macrumors newbie
Aug 20, 2009
29
0
San Diego

schoeringhumer

macrumors newbie
Original poster
Sep 2, 2009
9
0
the link you gave me couldn't help me, but thx ...

is anybody out there who can give me the code to e.g. set the label of a pdf-page ...

there is a function which returns the label of a pdfpage as an NSString, but i don't know how to add an normal NSString to the left top side of a page .... could somebody help me ?
 

`lowell`

macrumors newbie
Aug 20, 2009
29
0
San Diego
the link you gave me couldn't help me, but thx ...

is anybody out there who can give me the code to e.g. set the label of a pdf-page ...

there is a function which returns the label of a pdfpage as an NSString, but i don't know how to add an normal NSString to the left top side of a page .... could somebody help me ?

ha oops

for some reason i thought you were asking how add pages to a doc.. my bad!
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,420
A sea of green
nobody out there, who has any kind of knowledge about pdfkit ... ?

PDFKit doesn't create or modify PDF pages. It lets you view PDF documents, access content of the document, add annotations, etc.

http://developer.apple.com/mac/libr...tGuide/PDFKit_Prog_Conc/PDFKit_Prog_Conc.html

From the summary for PDFPage:

As you might expect, the PDFPage class represents pages in a PDF document. Your application instantiates a PDFPage object by asking for one from a PDFDocument object. PDF page objects are what the user sees onscreen, and a view may display more than one page at a time. You can use PDFPage to render PDF content onscreen, add annotations, count characters, define selections, and get the textual content of a page as an NSString or NSAttributedString object.

Note that in the bold text, there is no mention of "add content to the page".

If you want to add content to a PDF document, you need a PDF renderer or PDF painter. This will often be coupled with a PDF parser.

http://developer.apple.com/mac/libr...eptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.