I’m not sure how that would work. Adding javascript to PDF files is a whole adventure unto itself.

]]>I am not sure if you will be able to help – but i just discovered your code and thought it might be useful in creating text from opentype.js …

i got the path from opentype.js as follows

{“commands”:[{“type”:”M”,”x”:21.12,”y”:-5.5680000000000005},{“type”:”C”,”x1″:19.456,”y1″:-4.5440000000000005,”x2″:18.112000000000002,”y2″:-4.096,”x”:16.64,”y”:-4.096},{“type”:”C”,”x1″:13.696,”y1″:-4.096,”x2″:12.608,”y2″:-5.696,”x”:12.608,”y”:-9.088000000000001},{“type”:”L”,”x”:12.608,”y”:-29.248},{“type”:”L”,”x”:20.416,”y”:-29.248},{“type”:”L”,”x”:21.12,”y”:-33.728},{“type”:”L”,”x”:12.608,”y”:-33.728},{“type”:”L”,”x”:12.608,”y”:-42.048},{“type”:”L”,”x”:6.72,”y”:-41.344},{“type”:”L”,”x”:6.72,”y”:-33.728},{“type”:”L”,”x”:1.344,”y”:-33.728},{“type”:”L”,”x”:1.344,”y”:-29.248},{“type”:”L”,”x”:6.72,”y”:-29.248},{“type”:”L”,”x”:6.72,”y”:-9.024000000000001},{“type”:”C”,”x1″:6.72,”y1″:-3.2,”x2″:9.536,”y2″:0.768,”x”:15.808,”y”:0.768},{“type”:”C”,”x1″:18.624,”y1″:0.768,”x2″:21.312,”y2″:0,”x”:23.36,”y”:-1.536},{“type”:”Z”},{“type”:”M”,”x”:55.168,”y”:-14.848},{“type”:”C”,”x1″:55.232,”y1″:-15.616,”x2″:55.296,”y2″:-16.704,”x”:55.296,”y”:-17.856},{“type”:”C”,”x1″:55.296,”y1″:-28.16,”x2″:50.495999999999995,”y2″:-34.496,”x”:41.664,”y”:-34.496},{“type”:”C”,”x1″:32.704,”y1″:-34.496,”x2″:27.392,”y2″:-27.008,”x”:27.392,”y”:-16.832},{“type”:”C”,”x1″:27.392,”y1″:-6.336,”x2″:32.576,”y2″:0.768,”x”:42.623999999999995,”y”:0.768},{“type”:”C”,”x1″:46.976,”y1″:0.768,”x2″:50.751999999999995,”y2″:-0.768,”x”:53.888000000000005,”y”:-3.2640000000000002},{“type”:”L”,”x”:51.2,”y”:-7.168},{“type”:”C”,”x1″:48.32,”y1″:-4.8,”x2″:45.824,”y2″:-4.032,”x”:42.751999999999995,”y”:-4.032},{“type”:”C”,”x1″:37.632,”y1″:-4.032,”x2″:34.176,”y2″:-7.36,”x”:33.664,”y”:-14.848},{“type”:”Z”},{“type”:”M”,”x”:41.664,”y”:-29.824},{“type”:”C”,”x1″:46.912,”y1″:-29.824,”x2″:49.344,”y2″:-26.176000000000002,”x”:49.472,”y”:-19.2},{“type”:”L”,”x”:33.664,”y”:-19.2},{“type”:”C”,”x1″:34.112,”y1″:-26.432000000000002,”x2″:37.056,”y2″:-29.824,”x”:41.664,”y”:-29.824},{“type”:”Z”},{“type”:”M”,”x”:72.96000000000001,”y”:-3.968},{“type”:”C”,”x1″:69.376,”y1″:-3.968,”x2″:66.24000000000001,”y2″:-5.184,”x”:63.616,”y”:-7.36},{“type”:”L”,”x”:60.352000000000004,”y”:-3.648},{“type”:”C”,”x1″:63.29600000000001,”y1″:-1.088,”x2″:67.392,”y2″:0.768,”x”:73.08800000000001,”y”:0.768},{“type”:”C”,”x1″:79.808,”y1″:0.768,”x2″:86.4,”y2″:-2.3040000000000003,”x”:86.4,”y”:-9.536},{“type”:”C”,”x1″:86.4,”y1″:-16.064,”x2″:81.664,”y2″:-18.240000000000002,”x”:75.712,”y”:-19.904},{“type”:”C”,”x1″:70.016,”y1″:-21.44,”x2″:67.904,”y2″:-22.528,”x”:67.904,”y”:-25.408},{“type”:”C”,”x1″:67.904,”y1″:-28.096,”x2″:70.528,”y2″:-29.824,”x”:74.176,”y”:-29.824},{“type”:”C”,”x1″:77.76,”y1″:-29.824,”x2″:80.256,”y2″:-28.8,”x”:82.688,”y”:-27.136},{“type”:”L”,”x”:85.31200000000001,”y”:-31.104},{“type”:”C”,”x1″:82.56,”y1″:-33.088,”x2″:79.04,”y2″:-34.496,”x”:74.432,”y”:-34.496},{“type”:”C”,”x1″:67.328,”y1″:-34.496,”x2″:61.824000000000005,”y2″:-30.72,”x”:61.824000000000005,”y”:-25.024},{“type”:”C”,”x1″:61.824000000000005,”y1″:-19.52,”x2″:65.72800000000001,”y2″:-16.896,”x”:71.808,”y”:-15.36},{“type”:”C”,”x1″:78.464,”y1″:-13.696,”x2″:80.06400000000001,”y2″:-12.416,”x”:80.06400000000001,”y”:-9.088000000000001},{“type”:”C”,”x1″:80.06400000000001,”y1″:-5.952,”x2″:77.248,”y2″:-3.968,”x”:72.96000000000001,”y”:-3.968},{“type”:”Z”},{“type”:”M”,”x”:109.76,”y”:-5.5680000000000005},{“type”:”C”,”x1″:108.096,”y1″:-4.5440000000000005,”x2″:106.75200000000001,”y2″:-4.096,”x”:105.28,”y”:-4.096},{“type”:”C”,”x1″:102.336,”y1″:-4.096,”x2″:101.248,”y2″:-5.696,”x”:101.248,”y”:-9.088000000000001},{“type”:”L”,”x”:101.248,”y”:-29.248},{“type”:”L”,”x”:109.056,”y”:-29.248},{“type”:”L”,”x”:109.76,”y”:-33.728},{“type”:”L”,”x”:101.248,”y”:-33.728},{“type”:”L”,”x”:101.248,”y”:-42.048},{“type”:”L”,”x”:95.36,”y”:-41.344},{“type”:”L”,”x”:95.36,”y”:-33.728},{“type”:”L”,”x”:89.984,”y”:-33.728},{“type”:”L”,”x”:89.984,”y”:-29.248},{“type”:”L”,”x”:95.36,”y”:-29.248},{“type”:”L”,”x”:95.36,”y”:-9.024000000000001},{“type”:”C”,”x1″:95.36,”y1″:-3.2,”x2″:98.176,”y2″:0.768,”x”:104.44800000000001,”y”:0.768},{“type”:”C”,”x1″:107.264,”y1″:0.768,”x2″:109.952,”y2″:0,”x”:112,”y”:-1.536},{“type”:”Z”}],”fill”:”black”,”stroke”:null,”strokeWidth”:1}

implemented a simple addition to your code for testing

$pdf->SetDrawColor (120, 120, 255);

$pdf->SetFillColor (175, 238, 238);

$pdf->SetLineWidth(0.01);

for($i=0;$icommands);$i++){

$o = $path->commands[$i];

// error_log(json_encode($o).”\n”);

if($o->type==’M’){

$pdf->MoveTo( floatval( $o->x ), floatval( $o->y ));

}

else if($o->type==’C’){

$pdf->CurveTo(

floatval( $o->x ),floatval( $o->y ) ,

floatval( $o->x1 ), floatval( $o->y1 ),

floatval( $o->x2 ), floatval( $o->y2 ) );

}

else if($o->type==’L’){

$pdf->LineTo(floatval( $o->x ), floatval( $o->y ));

}

else if($o->type==’Z’){

$pdf->ClosePath();

}

else{

error_log(“unknown type “.$o->type);

}

}

$pdf->DrawPath(“FD”);

but nothing appears …

any help would be greatly appreciated

Thanks for the feedback! I write that kind of tutorial to teach myself how to understand other people’s programs. Glad that it could help someone else.

]]>$(“#tbRequestGeneric”).trigger({type: ‘keydown’, key: “ArrowLeft”|| “←”});

I changed it to :

$(“#tbRequestGeneric”).sendkeys(“{ArrowLeft}”);

But it still does the same thing… the “Insert point” moves (i.e. characters are getting inserted in the proper point), but the cursor stays at the end..

I’ve been killing myself with this for 2 days now!!

You are using `sendkeys(“right”);` when you should be using `sendkeys(“{ArrowRight}”);`. Note that the commands need to enclosed in curly braces, and the name is `ArrowRight` or `rightarrow`, not `right`.

Hope this helps.

Danny