This discussion is archived
6 Replies Latest reply: Apr 26, 2013 4:23 PM by George AV RSS

Get page size using vuebean etc api

pault Newbie
Currently Being Moderated
Hi

We are trying to scale markup entities to a fixed size and we can use getPageExtents() but this does not appear to be in real world coordinates eg 11.7" by 8.3".

Please advise how scaling works and where we can get the scale factors in the api. There seem to be lots of api calls that might do this!

Thanks.
  • 1. Re: Get page size using vuebean etc api
    pault Newbie
    Currently Being Moderated
    For PDFs at least, entity.getPoint().x / fileInfo.getInsertion().dpi returns the offset.
  • 2. Re: Get page size using vuebean etc api
    pault Newbie
    Currently Being Moderated
    Please cam someone advise on dwg and doc format? Thanks.
  • 3. Re: Get page size using vuebean etc api
    pault Newbie
    Currently Being Moderated
    Please cam someone advise for vector formats - dwg/dwf and doc/docx?

    Thanks

    Paul
  • 4. Re: Get page size using vuebean etc api
    George AV Newbie
    Currently Being Moderated
    Hi Paul,

    Have you tried VueBean.getPageSize()?
    It should be in world coordinates.
    Please note that vector files (including PDF) have the Y axis pointing up.

    You can also use convert between client and world coordinates by using:
    VueBean.clientToWorld() and VueBean.worldToClient().

    Thanks

    George
  • 5. Re: Get page size using vuebean etc api
    pault Newbie
    Currently Being Moderated
    Hi George,

    Thanks for your help, but we could do with more information.

    Do you have any chunks of sample code? We tried with DWF but the dimensions did not match those on the 'Properties' screen, and there was no clue on how to get whether the size is mm or inches?

    Thanks

    Paul
  • 6. Re: Get page size using vuebean etc api
    George AV Newbie
    Currently Being Moderated
    Hi Paul,

    There are thee types of coordinates used by AutoVue:
    1) World coordinates: these are the coordinate space that the drawing or model is represented in the file format.
    2) Device coordinates: these are pixel coordinates relative to the client's rendering area.
    3) Physical coordinates: these are in mm or inches and are displayed in the AutoVue UI (status bar, measure tool and properties dialog).

    I have shown you how to convert between the first two in my previous reply.
    To convert between world and phyical coordinates, you could use the PAN_CtlFileInfo.Ins class (insertion information).
    Multiply by VueBean.getFileInfo().getInsertion().scale and possibly subtract the offset too (before or after the multiplication, I didn't verify).
    The result will be in physical coordinates that are in the units and can be looked up in the Constants class.

    For example, PDF world coordinates are usually in the thousands, but show as inches (8.5x11) in the UI.

    I hope this helps.

    Thanks

    George

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points