Thanks Tim, looks like a start.<div><br></div><div>Question: </div><div> * Is the 20 value in $spacing a mm or cm?  Is there a way to change the PDF x/y coordinates into another unit (mm, picas, inches, nanometers, etc)</div>

<div><br></div><div>(I didn't print the resulting PDF yet, so I could measure...)<br><br>Dan<br><br><div class="gmail_quote">On Wed, Apr 11, 2012 at 18:19, Tim <span dir="ltr"><<a href="mailto:iceburn@dangerzone.com">iceburn@dangerzone.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">not 100% sure this meets your precision requirements...<br>
<br>
-tim<br>
<br>
#for Dan, 2012<br>
<br>
use PDF::API2 qw();<br>
#perhaps the best documentation for PDF::API2 is<br>
#<a href="http://pdfapi2.sourceforge.net/pdfapi2_for_fun_and_profit_APW2005.pdf" target="_blank">http://pdfapi2.sourceforge.net/pdfapi2_for_fun_and_profit_APW2005.pdf</a><br>
<br>
$pdf=PDF::API2->new;<br>
<br>
$pdf->mediabox('A4');<br>
$page=$pdf->page;<br>
$gfx=$page->gfx;<br>
$gfx->linewidth(1);<br>
$gfx->strokecolor('black');<br>
<br>
my $x = 100;<br>
my $tick = 10;<br>
my $spacing = 20;<br>
<br>
$gfx->move($x,50);<br>
$gfx->line($x,800);<br>
$gfx->stroke;<br>
<br>
for(my $y=50; $y<=800; $y+=$spacing){<br>
        $gfx->move($x,$y);<br>
        $gfx->line($x+$tick,$y);<br>
        $gfx->stroke;<br>
}<br>
<br>
$pdf->saveas('DansRuler.pdf');<br>
<div><div class="h5"><br>
On Wed, Apr 11, 2012 at 5:15 PM, Dan Linder <<a href="mailto:dan@linder.org">dan@linder.org</a>> wrote:<br>
> I'd like to see if anyone has ever worked with the PDF modules for Perl?<br>
>  Specifically, I'm looking to print a ruler (something like here:<br>
> <a href="http://www.vendian.org/mncharity/dir3/paper_rulers/" target="_blank">http://www.vendian.org/mncharity/dir3/paper_rulers/</a> ), but I need to adjust<br>
> the spacing between ticks and put in my own numbers for the new marks.<br>
><br>
> Most (all?) of the examples I've found are concentrating on placing blocks<br>
> of text and a couple images on the page.  What I need is a way to precisely<br>
> place tic marks and text next to them every so often.<br>
><br>
> Any hints or code snippets?   I had hoped someone would have made a generic<br>
> ruler printing page, but haven't found that yet.<br>
><br>
> Dan<br>
><br>
> My use? I'm printing a custom timing tape for my 350 V8 - as luck would have<br>
> it, each degree is 2mm on this flywheel.  My first attempt was to print a<br>
> blank cm/mm ruler, then hand print the degree numbers.  I'd like something a<br>
> bit more professional looking - possibly have it printed onto a<br>
> brass/aluminum tape that could be affixed to the engine.<br>
><br>
> --<br>
> ***************** ************* *********** ******* ***** *** **<br>
> "Quis custodiet ipsos custodes?"<br>
>     (Who can watch the watchmen?)<br>
>     -- from the Satires of Juvenal<br>
> "I do not fear computers, I fear the lack of them."<br>
>     -- Isaac Asimov (Author)<br>
> ** *** ***** ******* *********** ************* *****************<br>
><br>
</div></div>> _______________________________________________<br>
> Omaha-pm mailing list<br>
> <a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/omaha-pm" target="_blank">http://mail.pm.org/mailman/listinfo/omaha-pm</a><br>
_______________________________________________<br>
Omaha-pm mailing list<br>
<a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/omaha-pm" target="_blank">http://mail.pm.org/mailman/listinfo/omaha-pm</a></blockquote></div><br><br clear="all"><div><br></div>-- <br>***************** ************* *********** ******* ***** *** **<br>

"Quis custodiet ipsos custodes?"<br>    (Who can watch the watchmen?)<br>    -- from the Satires of Juvenal<br>"I do not fear computers, I fear the lack of them."<br>    -- Isaac Asimov (Author)<br>** *** ***** ******* *********** ************* *****************<br>


</div>