Re: PDFImageRep problem from archives
Re: PDFImageRep problem from archives
- Subject: Re: PDFImageRep problem from archives
- From: Rich Van Deren (äèä) <email@hidden>
- Date: Wed, 13 Mar 2002 06:28:20 -0800
Thanks for your reply.
I spent most of the day trying to turn my PDF page. I also found and
example with texShop
http://www.uoregon.edu/~koch/texshop/texshop.html
I was stuck when I could not find the NSEraseRect function in Cocoa's
Java API. I could not figure out how to do this in Java. I am using
Java because I am using apache.org's FOP, formatting objects. I wish I
was back in Objective-C++.
Thanks again. Rich.
On Tuesday, March 12, 2002, at 04:10 , RFM wrote:
Rich,
I assume you are referring to the multi page issue from awhile ago.
Here is the way I did it using the image representation from the PDF
file.
The image rep is obtained from the NSArray *myArray = [NSImage
representations]
[(NSPDFImageRep*)imageRep setCurrentPage: your_page_number ];
NSEraseRect(destRect);
[imageRep drawInRect:destRect];
this assumes PDF only and will fail if the representation is not PDF.
You
can check for PDF like this...
//
// Instance method. Checks the NSImageRep types of the theNSImage
// instance var. Looks through its image representations for
// an NSPDFImageRep class and returns it if found, nil otherwise.
//
-(NSPDFImageRep*)pdfRepresentation
{
if ( theNSImage != nil )
{
NSArray *reps = [theNSImage representations];
unsigned index;
unsigned count = [reps count];
for (index = 0; index <count; index++)
{
NSPDFImageRep *pdfImageRep = [reps objectAtIndex:index];
if ([pdfImageRep isKindOfClass:[NSPDFImageRep class]])
{
return pdfImageRep;
}
}
}
return nil;
}
hope this helps....
Regards,
Bob
Rich Van Deren (???) wrote:
Did you ever get to the second page.
I found you in the archives. I am having the same problem you had
last
June.
From the Apple Documentation it sound like I need to 'draw' something
from the image.
Do you have an example. I am confused.
Thanks in advance.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.