No announcement yet.

PDF Annotations using TCPDF and FPDI (FreeTextCallout)

  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF Annotations using TCPDF and FPDI (FreeTextCallout)

    I am able to use the TCPDF Annotation() function on a PDF imported using FPDI.

    (I know the annotation note in TCPDF states not fully functional, but it works! Also TCPDF starts from Top Left in mm, where the annotation parameter is from Bottom Left)

    We can also use these annotation directly on PDF created through Scriptcase-pretty cool! Other annotations like Text, Comment, Note, FreeText->'Subtype' FreeTextTypewriter seem to work just fine.

    The issue is that the FreeTextCallout line is not showing up (see photo 2)-but the box with the text is...I am assuming I am passing a line that is not visible. I can see the nodes (node.png) for (x1, y1, x2, y2, x3, y3) but the line is invisible...but using PDF XChange Software as a reader, once I click on the annotation, it shows up...I assume their software then corrects what I am missing....any thoughts?

    Code for Annotation generation:

    $dastring = 'BT\n/Ft18 12 Tf \n 1 0 0 rg \n<>Tj ET\n';

    $pdf->Annotation($xpos,$ypos,7,$boxh+(2*$yadj),$mydataa rray,array('Subtype'=>'FreeText', 'Border'=>array(0,0,1), 'DA'=>$dastring, 'IT'=>'FreeTextCallout', 'CL'=>array($xstart, $ystart, $xknee, $yknee, $xfin, $yfin),'LE'=>'OpenArrow', 'Q'=>1));

    Photo 1 is from the PDF Ref 1.7 manual
    Photo 2 is what is showing from my code
    Photo 3 is what is shown after I click the annotation in PDF Xchange
    Photo 4 shows nodes, but lines are not visible

    I think I need to add something to the 'DA' string or I am inheriting a line type that is hidden or has a thickness of 0???

    $boxh+(2*$yadj) in the Annotation() (3rd position in the array code above) is used to calculate the exact midpoint-I thought that was the problem at first (it still may be, but not sure)

    Please help!! Been stuck on this for a few days...

  • #2
    Anyone have ideas on this yet?


    • #3
      I still could use help on this...anyone with ideas?