PDFPage Creation query
PDFPage Creation query
- Subject: PDFPage Creation query
- From: "Amrit Majumdar" <email@hidden>
- Date: Thu, 22 May 2008 13:50:28 +0530
Hi All,
I am playing around with the PDFKit.
I was planning to create a new PDFDocument, with my own PDF Page that I
generate after subclassing PDFPage
Accordingly I subclassed PDFPage and have over-riden the following
menthods.
- (id)initWithImage:(NSImage *)image;
Steps I followed to create a new PDFPage from the data in another PDFPage.
NSData *myData = [[ pdfDoc pageAtIndex:0 ]dataRepresentation ];
//retreiving data from pdfDoc, a pre existing PDF.
NSImage *img = [[NSImage alloc]initWithData:myData];
MyPDFPageClass *myPDFPage = [[ MyPDFPageClass alloc ]initWithImage:img];
PDFDocumebnt *myNewPDFDoc = [[PDFDocument alloc]init];
[ myNewPDFDoc insertPage:myPDFpage atIndex: 0 ];
[myPDFView setDocument:myNewPDFDoc];
The "pdfDoc" in the above code snippet was initialised to an Apple
Documentation PDF.
On the first page it has the title of the doc and an apple logo at the
bottom left hand side.
When the new page is displayed in the PDFView it displays a gray colored
page.
The Apple logo at the bottom of this new page is visible but it is very
faint.No other data present in the original page is visible in this new
page.
Why does this happen?
I am sure I have messed up somewhere....but not sure where and how to
proceed to create a new PDFPage in a proper fashion.
How do I proceed?
Best Regards,
Amrit.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden