I am writing some text with specific text rectangles to a PDF using the following code:
//**** TEXT BEGIN
PTElement *textBegin = [elementBuilder CreateTextBegin];
[elementWriter WriteElement:textBegin];
//**** TEXT RUN
PTElement *textRun = [elementBuilder CreateTextRunWithFont:myTestWord.m_wordContent font:[PTFont Create: [pdfDocument GetSDFDoc] type: e_pttimes_roman embed: NO] font_sz:wordRect.Height ];
[textRun SetTextMatrix:1 b:0 c:0 d:1 h:myTestWord.m_wordX4 v:myTestWord.m_wordY4];
PTGState *gStateTextRun = [textRun GetGState];
[gStateTextRun SetLineWidth:1];
[gStateTextRun SetTextRenderMode:e_ptfill_stroke_clip_text];
[gStateTextRun SetStrokeColorSpace:[PTColorSpace CreateDeviceRGB]];
[gStateTextRun SetFillColorSpace:[PTColorSpace CreateDeviceRGB]];
[gStateTextRun SetStrokeColorWithColorPt:[[PTColorPt alloc] initWithX: 1 y: 0 z: 0 w: 0]];
[gStateTextRun SetFillColorWithColorPt:[[PTColorPt alloc] initWithX: 1 y: 0 z: 0 w: 0]];
[gStateTextRun SetFillOpacity: 1.0];
[elementWriter WriteElement:textRun];
//**** TEXT END
[elementWriter WriteElement:[elementBuilder CreateTextEnd]];
NSLog(@“Written element %@ to PDF.”,myTestWord.m_wordContent);
How do I calculate the horizontal scale factor in the SetTextMatrix to fill the entire text rectangle?
If I understand it correctly the horizontal ScaleFactor 1 should be modified to fill the entire text rectangle .
Regards,