Thursday, 15 July 2010

ios - Adobe RM SDK Annotation -


Have you used people RM SDK for iOS? RM SDK saves annotations in the following format:

  startbookmark = "#pdfloc (BD 0d, 0,101,5,2,0,0,1)"; Endbookmark = "# PDFFL (BD 0d, 0,101,14,0,0,1,1)";  

How can we get these 2 lines?

You have a PDF location, point to a specific object in a PDF file. This object is not directly related to coordinates (x, y) on the screen because it depends on the resolution and the dpi that you use to render the pdf file. It also depends on the rendering engine that you use to render the file.

To make a box in iOS, you have to draw it using (x, y) coordinates. You need to get the coordinates (X, Y) of the box surrounding the exontence you are working with. You can do this with RMSDK using getRangeInfo . You can also use the above PDF locations to navigate special annotations. Note that the box you return to is valid only for the presentation of your file, in which you have parameters. If you change any parameters - RMSDK version, Navigation Matrix value, DPI, Rendering resolution, then you will need to get a new value for the box from RMSDK.

Here are some code that will help you (X, Y) coordinate with two places using RMSDK. The code is for main C / C ++ library, because I'm not sure what your purpose is like-a layer. It may vary depending on the version of RMSDK you are using.

  dpdoc :: RangeInfo * rangeInfo = renderer- & gt; GetRangeInfo (Startbookmark, EndBookmark); Dpdoc :: rectangle * rect; Category Info-> Getbox (0, false, root & amp;;);  

Then the "rect" variable (x, y) coordinates, which you need to attract, will be included. Note that there are several boxes for every 2 sets of coordinates in that case, you will need a loop by them.

If you have a purpose-layer that usually comes with RMSDK, then it should be a little easier. In that case, the code should look something like this:

  NSArray * box = noil; RMRangeInfo * rangeInfo = [document getRangeInfoWithStart: Startbookmark End: EndBookmark]; Boxes = Category Info Boxes  

Then you can repeat through the array of boxes to get (x, y) and draw them on the screen. In most cases you will get 1 box, but for those cases you should have an account where you have many boxes, a simple loop should do the trick.


No comments:

Post a Comment