Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:22:20+00:00 2026-05-25T14:22:20+00:00

I want to display PDF file in iPad using CATiled Layer All is well

  • 0

I want to display PDF file in iPad using CATiled Layer
All is well but when i use CATiledLayer in my app and run it , PDF file will display like this shown in imageHere i saw in iPad the top left corner full of gray color in PDF file displayed in red rounded rectangle

Here is my Code

For CATiled layer

   tiledLayer = [CATiledLayer layer];
     tiledLayer.delegate = self;
     //Set load block of tiled layer
     tiledLayer.tileSize = CGSizeMake(1024.0, 1024.0);
     tiledLayer.levelsOfDetail = 1000; 
     tiledLayer.levelsOfDetailBias = 1000;

For drawInContext

 CGContextSetRGBFillColor(ctx, 1.0, 1.0, 1.0, 1.0);
     CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
     CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height);
     CGContextScaleCTM(ctx, 1.0, -1.0);
     CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(myPageRef, kCGPDFCropBox, layer.bounds, 0, true));
     CGContextDrawPDFPage(ctx, myPageRef);

Please help me to solve this problem.Thank u in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:22:20+00:00Added an answer on May 25, 2026 at 2:22 pm

    CGPDFPageGetDrawingTransform does not scale your pdf up – you need to write your own transform code to calculate the best aspect ratio for the pdf.

    Note that CGPDFPageGetDrawingTransform also checks for rotation in the pdf, you can use sth like this to correct it manually:

    int rotate = CGPDFPageGetRotationAngle(page);
        switch (rotate) {
            case 0:
                renderingSize.width = roundf(cropBox.size.width * zoom / 100);
                renderingSize.height = roundf(cropBox.size.height * zoom / 100);
                CGContextTranslateCTM(context, 0, cropBox.size.height);
                CGContextScaleCTM(context, 1, -1);
                break;
            case 90:
                renderingSize.width = roundf(cropBox.size.height * zoom / 100);
                renderingSize.height = roundf(cropBox.size.width * zoom / 100);
                CGContextScaleCTM(context, 1, -1);
                CGContextRotateCTM(context, -M_PI / 2.f);
                break;
            case 180:
            case -180:
                renderingSize.width = roundf(cropBox.size.width * zoom / 100);
                renderingSize.height = roundf(cropBox.size.height * zoom / 100);
                CGContextScaleCTM(context, 1, -1);
                CGContextTranslateCTM(context, cropBox.size.width, 0);
                CGContextRotateCTM(context, M_PI * 1.f);
                break;
            case 270:
            case -90:
                renderingSize.width = roundf(cropBox.size.height * zoom / 100);
                renderingSize.height = roundf(cropBox.size.width * zoom / 100);
                CGContextTranslateCTM(context, cropBox.size.height, cropBox.size.width);
                CGContextRotateCTM(context, M_PI / 2.f);
                CGContextScaleCTM(context, -1, 1);
                break;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse the tabular information from a .pdf file,and want to display
I have a strange issue in phonegap framework. I want to display PDF file
I want to read a pdf file and display it in the UI in
We want to display a pdf-file on a webpage. From what i can think
I have a PDF file stored in server and I want to display it
I want to display a pdf file in a UIWebView . My PDF is
net mvc 3. I want to display the pdf file as a part of
I want to display a pdf file in some viewer control by just defining
I want a php page to 'display' a pdf. Here is the code: <?php
I want to display tabular type data, but it will not be coming from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.