Software Companions Support Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Harry

Registered:
Posts: 5
Reply with quote  #1 
Hi!

i'm getting confused while trying to place a Textstring (MarkupCreateText) on my Drawings. I realised there's some calculation required to convert the position to screen, world (?) coordinates?

The Text will be placed while the control itself is hidden, always say 190mm from right, 50mm from bottom of the Drawing PDF File (e.g. A0 1189x841), so right over the title, 45°

I can create Text, but the i only hit the correct position only by accident...

What calculation is required or what would be best practice to place the Text on a Page based on Page width and height?

Thx. in advance for any hint or push in the right direction!

Harry
 
softcomp

Administrator
Registered:
Posts: 430
Reply with quote  #2 

Hi,

To convert from mm to world coordinates you will need to do the following calculation:

worldx = 195 / 25.4 * 1016 = 7800
worldy = 50 / 25.4 * 1016 = 2000

(internal dpi is always 1016).


We will release an update later this with some additions to the XML format (can be added with MarkupCreateFromXML).
With this update you place the text by center position and also by using a percentage of the page size.
Sample XML code:

<?xml version="1.0" encoding="UTF-8"?>
<SCMarkupFormat>
<Header>
<Unit>mm</Unit>
</Header>
<Layers>
<layer name="Markup Layer" color="#00FF00" enabled='1'/>
</Layers>
<Elements>

<Element>
<type>Text</type>
<layer>0</layer>
<page>0</page>
<center x="195" y="50"/>
<font height='10' facename='Times New Roman'/>
<rotation>0</rotation>
<text>This is text</text>
<textcolor>#0000FF</textcolor>
</Element>

<Element>
<type>Text</type>
<layer>0</layer>
<page>0</page>
<center x="50%" y="50%"/>
<font height='10' facename='Times New Roman'/>
<rotation>0</rotation>
<text>Centered Text</text>
<textcolor>#FF0000</textcolor>
</Element>

</Elements>
</SCMarkupFormat>

First text is placed with center 195mm from left and 50mm from bottom.
Second text is placed with center at 50% of both page width and height.
In both cases the text font height is 10mm.

The XML format is a lot more flexible as you can also place other markup types, like for example stamps, barcodes, pictures and more.

Please don't hesitate to contact us if you have any questions.
Regards,
Support

Harry

Registered:
Posts: 5
Reply with quote  #3 
Yesss! That did it!

Meanwhile i used the xml Version which worked perfect. But for this issue i'll turn back to the 'MarkupCreateText' as it's simple to use (once you get it to turn around the formula [crazy])

The xml Markup Version will enter the show again when i have to place complete BOMs on the Drawings.

Thx. for your Help!

Cheers,

Harry


Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.