Search Results

Search found 3 results on 1 pages for 'skantner'.

Page 1/1 | 1 

  • Wider than expected margins with CGContextDrawPDFPage

    - by skantner
    I'm rendering PDF pages on iPhone using the code below. It works, but the margins seem much wider than when I view the same PDF using a Acrobat Reader or the Mac's Preview, and that consequently scales the content down much smaller than it otherwise would be. Is my code actually causing this behavior? CGContextSetStrokeColorWithColor(context, backgroundColor.CGColor); CGContextSetFillColorWithColor(context,backgroundColor.CGColor); CGContextSetLineWidth(context, 2.0); CGContextAddRect(context, CGRectMake(0.0,0.0, self.bounds.size.width, self.bounds.size.height)); CGContextDrawPath(context, kCGPathFillStroke); CGContextTranslateCTM(context, 0.0, self.bounds.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGPDFPageRef page = CGPDFDocumentGetPage(myPDF, (size_t) pageNum); CGContextSaveGState(context); CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, self.bounds, 0, true); CGContextConcatCTM(context, pdfTransform); CGContextDrawPDFPage(context, page); CGContextRestoreGState(context);

    Read the article

  • iphone certain PDFs rendering as black image

    - by skantner
    I'm trying to draw the pages of a PDF using the code below. Some PDF's render correctly, but others simply show as a completely black image, or have partial portions rendered and the rest black. In comparing what's going on, the ones that show OK seem to have always have "regular" text in them along with some graphics (diagrams, etc.), while the ones that come out black are typically all graphics (like a page of sheet music, for example). Can anyone point me in the right direction on this? I building this on the new 3.2 SDK. Thanks! // PDF page drawing expects a Lower-Left coordinate system, so we flip the coordinate system // before we start drawing. CGContextTranslateCTM(context, 0.0, self.bounds.size.height); CGContextScaleCTM(context, 1.0, -1.0); // Grab the first PDF page CGPDFPageRef page = CGPDFDocumentGetPage(myPDF, pageNo); // We're about to modify the context CTM to draw the PDF page where we want it, so save the graphics state in case we want to do more drawing CGContextSaveGState(context); // CGPDFPageGetDrawingTransform provides an easy way to get the transform for a PDF page. It will scale down to fit, including any // base rotations necessary to display the PDF page correctly. CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, self.bounds, 0, true); // And apply the transform. CGContextConcatCTM(context, pdfTransform); // Finally, we draw the page and restore the graphics state for further manipulations! CGContextDrawPDFPage(context, page); CGContextRestoreGState(context);

    Read the article

  • Is the iPhone/iPad delete "badge" available via the SDK?

    - by skantner
    I am creating an app with thumbnail views of my content. I would like to put a "delete" badge in the upper left corner of each thumbnail like the one you see either when deleting apps from the iphone/ipad home screen. It is typically a black circle with an 'X' inside. Is this a badge or image file made available somehow through the SDK? //Scott

    Read the article

1