0

I want do draw lines, rectangles, ... on a full zoomable pdf (so without quality loss) in an iphone/ipad project.

First: I have based me on this sample: http://www.olivetoast.com/blog/2009/08/simple-uiscrollview-catiledlayer-pdf-example/ This sample makes it possible to zoom on a PDF with full quality

Second: And i have also based on this sample: http://www.iphonedevbook.com/forum/viewforum.php?f=1&sid=6d52a0d08a8c6a807cdedfde6a041088 The sample named QuartzFun of this book. It's for drawing a line, rectangle, ...

These two samples are working perfectly separate, but when i want to combine them i can't draw a line... For making thins more simple i have already combined the code here: http://www.megafileupload.com/en/file/297790/SimpleTiledScrollExample-1-zip.html

Can someone tell me what to change to let this work?

Thanks in advance

meersmans
  • 463
  • 5
  • 14

1 Answers1

1

First of all, do not use Quartz to draw onto existing PDF files. It works mostly, but it doesn't work properly when the fonts used in the original file are not available on the iPhone/iPad and you get all kinds of results.

Secondly, think of drawing the lines on screen and writing them to a PDF file as two separate actions. That is, draw the objects on to a layer on the screen using Quartz2D and then for PDF-rendering use a function which translates the objects on your screen to PDF commands for the PDF-library of your choice.

The PoDoFo library is a good choice and there is information online about compiling it for the iOS. For PaperPad I had originally written my own simple PDF-Render library but it will also switch to PoDoFo in the next update.

Cheers, Engin.

Engin Kurutepe
  • 6,719
  • 3
  • 34
  • 64
  • Hi, First of all thanks for you the answer! Can you maybe refer to an online sample code that looks like your answer of the second paragraph? Podofo looks something difficult to run on ios... when i look it up people are just speaking of it and i cant find any sample code of it. – meersmans Jan 26 '11 at 14:26