Questions tagged [cgpdfcontext]

32 questions
12
votes
2 answers

How to draw text in PDF context in Swift?

I have a simple function that create pdf file and return its path. func createPDFFileAndReturnPath() -> String { let fileName = "pdffilename.pdf" let paths = NSSearchPathForDirectoriesInDomains(.LibraryDirectory, .UserDomainMask, true) …
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
5
votes
2 answers

Exception releasing context after CGContextDrawPDFPage only for some pages

I've inherited some iOS code which opens a source PDF and creates a CGContextRef to which we draw a single page from the source document. The problem is that there are certain pages with one document, our help document unfortunately, which causes…
Robert Gowland
  • 7,677
  • 6
  • 40
  • 58
5
votes
2 answers

iOS PDF editing - Combining FastPDFKit / CGPDFContext and libHaru

I'm trying to add PDF Annotations onto an existing PDF file in iOS. I understand that using FASTPDFKit / CGPDFContext, it is possible to READ ( but not EDIT ) almost all the information from an existing PDF File ( Correct me if I'm wrong ). I also…
Mahadevan Sreenivasan
  • 1,144
  • 1
  • 9
  • 26
5
votes
4 answers

PDF files created on iPad don't display correctly on Windows

My iPhone app creates PDF files (in Arial font). The plain iPhone 3.1.x version works great (other than the known issue that PDF files created on the iPhone can't be viewed correctly in Google Docs or on the BlackBerry). As I am updating my project…
Morgan
  • 814
  • 9
  • 10
4
votes
0 answers

Save PDF in CMYK colour profile

I have an iOS app written in Swift, where you can create images with texts etc. In the end, you can create a PDF, which is destined for printing. I've got a response from the printing house that it has to be in 300 DPI, which I've fixed, but they…
Makalele
  • 7,431
  • 5
  • 54
  • 81
2
votes
0 answers

Printing from an iOS device (AirPrint)

I think I must be coming at this from the wrong angle. This is my first foray into PDF with Quartz. I would like to have the ability to print text that is entered into my app, but I may need to drop it in this release. I have read everything I…
Rob
  • 4,149
  • 5
  • 34
  • 48
2
votes
1 answer

Move data between PDFDocument and CGPDFContext?

I want to move data between PDFKit's PDFDocument and Core Graphics's CGPDFContext, but I can't see how to do it. I'm using python, but any code that shows what methods and objects to use would be welcome. Using CGPDFDocument would be easy, but there…
benwiggy
  • 1,440
  • 17
  • 35
2
votes
2 answers

iPhone/iPad draw pdf like iBooks?

Does anyone know how to use core graphics to draw a pdf like in iBooks. I can already draw a pdf page using core graphics but was curious how iBooks shows a lower quality view of each page so it loads fast and then when you stay on a page longer it…
marchinram
  • 5,698
  • 5
  • 47
  • 59
2
votes
1 answer

CGPDFPageRef not rendering FreeText annotations

I am using CGContextDrawPDFPage to draw pdfs in a layer using standard techniques as mentioned here . The PDF Viewing is perfect for most of the pdfs. However FreeText Annotations in the PDF are not rendered at all. QLPreviewController successfully…
Qamar Suleiman
  • 1,228
  • 2
  • 18
  • 31
2
votes
2 answers

Rendering PDF in iOS

Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or…
Arun Gupta
  • 2,628
  • 1
  • 20
  • 37
1
vote
1 answer

PDF zooming inside UIScrollView

I have a 2835 pixel PDF file inside 2835 pixel UIScrollView. To display the PDF I use CATiledLayer. My problem is when I zoom out the scrollView (at scale below 1) the PDF quality gets very bad. What is strange that when I zoom in the scrollView (at…
alex
  • 279
  • 4
  • 14
1
vote
1 answer

How can I cleanly draw on a PDF both statically and dynamically on iOS?

I am currently working on an app where we would like to download a PDF from a remote server and then draw on it. We would like to draw Google Maps pin-like annotations on the PDF (the static draw part). Furthermore, we would like to detect if a user…
AyBayBay
  • 1,726
  • 4
  • 18
  • 37
1
vote
0 answers

Memory leak in convert PDF to image method (non-ARC)

I am maintaining a company's legacy app and am trying to reduce the amounts of crashes and memory leaks in a non-ARC project (sigh). I have identified a massive memory leak in a function that converts a PDF file into a UIImage but do not have enough…
Nick Kirsten
  • 1,187
  • 11
  • 27
1
vote
1 answer

CGPDFContextCreateWithURL not correctly creating context

Using the following code, the ctx is not correctly being created. It remains nil: #import @implementation UIView(PDFWritingAdditions) - (void)renderInPDFFile:(NSString*)path { CGRect mediaBox = self.bounds; …
mjdth
  • 6,536
  • 6
  • 37
  • 44
1
vote
0 answers

UIGraphicsEndPDFContext(); fails with Japanese NSAttributedText

Has anyone encountered Xcode failing at UIGraphicsEndPDFContext() after drawing to a context with Japanese text from a NSAttributedString? Luckily the first time I tested my code in Japanese, my iPhone was off-line and it worked. However, much…
Scott
  • 56
  • 6
1
2 3