Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
DrawLine poistioning |
Post Reply |
Author | |
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
Posted: 03 May 16 at 7:00PM |
When using Drawline with a width of, say, 2mm where are the X and Y positions? are they central to the line or are they set to a corner?
thanks
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Weetch,
they are there where you want it ;-) Where to begin you can set with SetOrigin. Which metric system you can set with SetMeasurementUnits. If you want the line at the top of the page you should save two mm if you want to see it ;-) |
|
Cheers,
Ingo |
|
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
|
Hi Ingo
what I have is SetOrigin(1); //top left SetMeasurementUnits(1); //mm SetLineWidth(0.7056); //2pts converted to mm DrawLine(12, 122, 12, 188); DrawLine(12, 188, 69, 188); The vertical line is slightly to the left and the bottom line slightly to the right and slightly lower - which means that the lines don't meet correctly at the corner. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
here you can read about: http://www.debenu.com/docs/pdf_library_reference/DrawLine.php X means horizontal and Y means vertical. Start means left and End means right. Perhaps it's better to use SetMeasurementUnits(0) 'cause DrawLine uses points, too (i think)? Don't forget the NormalizePage to avoid problems with rotated pages. If there are still slightly differences try another font. |
|
Cheers,
Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
BTW: 1 point is ...
25,4 mm div 72 = 0,353... |
|
Cheers,
Ingo |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
BTW: 1 mm is ...
72 div 25,4 => 2,834...
|
|
Cheers,
Ingo |
|
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
|
Thanks, I have trawled the function pages and docs. I have changed the setting of line sizes to points, but need to retain positioning as mm. The X,Y must be referencing a particular end point of the line but I can't see which. if we have (Origin = Top Left) startX = 1, startY = 1, endX = 10, EndY=1 (straight line for 10mm) say at 2mm wide - does the startX,StartY reference the top left hand corner, the left centre or the bottom left corner? If we have 2 lines StartX = 1, StartY = 1, EndX = 1, EndY = 10 StartX = 1, StartY = 10, EndX = 10, EndY = 10 then I would expect that the bottom of line 1 and the start of line 2 would either overlap completely or line 2 would butt up against line 1. However, line 2 overlaps part of the bottom of line one in both dimensions. |
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
If you need super accuracy, you may have to work it out by trial and error. Set the line thickness temporarily to much wider than you need, draw some lines, and get out a ruler to measure where the coordinate base is on the line. I suspect it will be quicker than asking here for a definitive answer!
Also remember that the start and end coordinates are double, not integer. To get absolute accuracy you may need to set Startx to 10.123, not just 10 or 11.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
The first line should start at 1 step to right and 1 step top (x1/y1).
It ends at the same horizontal step but 10 step to top. So it's a vertical line 9 steps long. The second line should start at 1 step to right and 10 step top (x1/y1). It ends horizontal 10 steps to right and 10 steps to top So it's a horizontal line 9 steps long. So together there should be a 90 degree rectangle. If there are few points not identical you should try a bit for better results and share your experiences with us. Thanks in advance ;-) |
|
Cheers,
Ingo |
|
rweetch
Senior Member Joined: 22 Feb 11 Status: Offline Points: 173 |
Post Options
Thanks(0)
|
In the end I used the draw path methods and just did a bit of fractions of a millimetre adjustments to get it to work.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store