RTFD to PDF
RTFD to PDF
- Subject: RTFD to PDF
- From: Neil Williams <email@hidden>
- Date: Thu, 19 May 2005 13:36:04 +0100
Hi
I am aiming to read a RTFD from disk, edit its
contents and write the output to a PDF file. I
would like the PDF to be a hybrid of text and
graphics i.e. not just a bit map representation of
the RTFD. Finally, I hope that the PDF page size
will be the same as the RTFD template. I will have
two templates - US Letter and A4.
I have read the docs and think I can do the above.
However, when I test the PDF output with the code
below I get an empty PDF. The problem is that
myRect is 0 by 0. I have also tried [theTemplate
frame] also to get a rectangle but it is 0 by 0
also. BTW the RTFD output is OK so there appears
to be no problems with reading the template.
NSText *theTemplate = [[NSText alloc] init];
if ([theTemplate readRTFDFromFile:templatePath]) {
//PDF Output
NSRect myRect = [theTemplate bounds];
NSData *pdfData = [theTemplate
dataWithPDFInsideRect:myRect];
[pdfData writeToFile:@"/testOutput.pdf"
atomically:YES];
//RTFD Output
[theTemplate writeRTFDToFile:@"/testOutput.rtfd"
atomically:YES];
}
else NSLog(@"Error reading template");
Any pearls of wisdom would be greatly appreciated.
Best regards
Neil Williams
Inverkeithing
Scotland
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden