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 3428460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:57:42+00:00 2026-05-18T06:57:42+00:00

i wrote code to display any type of file like pdf,svg,etc.But unfortunately my code

  • 0

i wrote code to display any type of file like pdf,svg,etc.But unfortunately my code is working with only pdf.the code is like this

-(void)drawRect : (CGRect)rect {
CGPDFPageRef myPage;
NSString * pathToPdfDoc = [[NSBundle mainBundle] pathForResource:@ "pdfdoc" ofType:@ "pdf"];
NSURL * pdfUrl = [NSURL fileURLWithPath:pathToPdfDoc];
// NSLog(@"%@",pdfUrl);
CGPDFContentStreamRef myContentStream;
document = CGPDFDocumentCreateWithURL((CFURLRef)pdfUrl);
// NSLog(@"%@",[document description]);
if (document) {
    int numOfPages = CGPDFDocumentGetNumberOfPages(document);
    // NSLog(@"%d",numOfPages);
    CGPDFPageRef myPage = CGPDFDocumentGetPage(document, pgno);
    myContentStream = CGPDFContentStreamCreateWithPage(myPage);
    // CGPDFOperatorTableRef myTable;
    // myScanner = CGPDFScannerCreate (myContentStream, myTable, NULL);
    // CGPDFPageRef page = CGPDFDocumentGetPage(document, 1);
    // page = CGPDFDocumentGetPage(document, 2);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextSaveGState(ctx);
    CGContextTranslateCTM(ctx, 0.0, [self bounds].size.height);
    CGContextScaleCTM(ctx, 1.0, -1.0);
    CGContextConcatCTM(ctx,
                       CGPDFPageGetDrawingTransform(myPage, kCGPDFCropBox, [self bounds], 0, true));
    CGContextDrawPDFPage(ctx, myPage);
    CGContextRestoreGState(ctx);
}

}

initially i thought that if i change “pathForResources:ofType”method argument is svg it will works but it is not working, can any one suggest me modifications.
thank you

  • 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-18T06:57:43+00:00Added an answer on May 18, 2026 at 6:57 am

    As per the comments to the question:

    • Learn more about using SVG images on the iPhone
      Check out SVG images in an iPhone application. The gist is, use a UIWebView,

    • SVG is not PDF

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i wrote following code to create a linkbutton programmatically, but its showing like lable
I wrote following code...but i am getting Error like: Error 1 'LoginDLL.Class1.Login(string, string, string)':
Below is the code which I wrote to display a tooltip content. As the
i added sharekitkit my project. And wrote code like here : SHKItem *item =
I wrote my code using this article at msdn as a primary helper My
I wrote some code to read a file in my Java Servlet class. (I'm
Dont worry we dont need to find out any bug in this code. Its
I have created a custom Payment module but I could only display the following
I am using JS to write HTML code where I need to display 2
I wrote a code to show a div element(shareform) when a link is clicked

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.