PDF Kit [PDFPage setBounds:forBox:] not working!

  • hi all,

    i am attempting to open a .pdf file using quartz's pdf kit framework and add programatically add a page to it and resave it.

    unfortunately the page does not render when i open the resulting pdf in preview (but it is in the outline). and before you ask, yes i am setting the crop box and media box to a valid rect (see below code).

    pdfPage = [[PDFPage alloc] initWithDocument : pdfDocument];
    [pdfPage setBounds:NSMakeRect( 0, 0, 595.2, 841.92 ) forBox:kPDFDisplayBoxCropBox];
    [pdfPage setBounds:NSMakeRect( 0, 0, 595.2, 841.92 ) forBox:kPDFDisplayBoxMediaBox];

    [pdfPage setDisplaysAnnotations:YES];

    [pdfDocument insertPage : pdfPage atIndex : 1]; // there is a page 0

    also, how do you programatically set the label?

    regards,
    warwick
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today