simple create pdf file with hard code
<p>I have generated pdf programatically bt problem is text doesnt appear in pdf.
PLz provide me simple example of pdf creator.</p>

<p>This is my code :</p>

<pre><code>-(void) MyCreatePDFFile //(CGRect pageRect, const char *filename)// 1
{

 CGRect pageRect=CGRectMake(10,10,400,600);
 const char *filename="/Users/msoni/Desktop/my.pdf";

    CGContextRef pdfContext;

    CFStringRef path;

    CFURLRef url;

    CFMutableDictionaryRef myDictionary = NULL;

 //const char *filename="a.pdf";

    path = CFStringCreateWithCString (NULL, filename,kCFStringEncodingUTF8);

    url = CFURLCreateWithFileSystemPath (NULL, path,kCFURLPOSIXPathStyle, 0);

    CFRelease (path);

    myDictionary = CFDictionaryCreateMutable(NULL, 0,

            &amp;kCFTypeDictionaryKeyCallBacks,

            &amp;kCFTypeDictionaryValueCallBacks); // 4

    CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));

    CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));

    pdfContext = CGPDFContextCreateWithURL (url, &amp;pageRect, myDictionary); // 5

    CFRelease(myDictionary);

    CFRelease(url);

    CGContextBeginPage (pdfContext, &amp;pageRect); // 6
 CGContextStrokeRect(pdfContext, CGRectMake(20, 100, 200,300));
 const char *text = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem";
 CGContextShowTextAtPoint (pdfContext, 100, 400, text, strlen(text));
 //CGContextSetTextDrawingMode (pdfContext);
 CGContextEndPage (pdfContext);// 8

    CGContextRelease (pdfContext);// 9

}
</code></pre>

<p>waiting for reply..</p>

<p>thank</p>
