private void WritePositioningOperator(PdfCanvas canvas) { if (firstPositioningOperands != null) { if ("T*".Equals(prevOperator)) { if (canvas.GetGraphicsState().GetLeading() != currLeading) { canvas.SetLeading((float)currLeading); } } PdfCleanUpProcessor.WriteOperands(canvas, firstPositioningOperands); } else { if (tdShift != null) { canvas.MoveText(tdShift[0], tdShift[1]); } else { if (tmShift != null) { canvas.SetTextMatrix(tmShift.Get(Matrix.I11), tmShift.Get(Matrix.I12), tmShift.Get(Matrix.I21), tmShift.Get (Matrix.I22), tmShift.Get(Matrix.I31), tmShift.Get(Matrix.I32)); } } } }
private void WriteText(String @operator, IList <PdfObject> operands, PdfArray cleanedText, PdfCanvas canvas ) { CanvasGraphicsState canvasGs = canvas.GetGraphicsState(); bool newLineShowText = "'".Equals(@operator) || "\"".Equals(@operator); if (newLineShowText) { if (canvasGs.GetLeading() != currLeading) { canvas.SetLeading((float)currLeading); } // after new line operator, removed text shift doesn't matter removedTextShift = null; } PdfTextArray tjShiftArray = null; if (removedTextShift != null) { float tjShift = (float)removedTextShift * 1000 / (canvasGs.GetFontSize() * canvasGs.GetHorizontalScaling() / 100); tjShiftArray = new PdfTextArray(); tjShiftArray.Add(new PdfNumber(tjShift)); } if (cleanedText != null) { if (newLineShowText) { // char spacing and word spacing are set via writeNotAppliedTextStateParams() method canvas.NewlineText(); } if (removedTextShift != null) { tjShiftArray.AddAll(cleanedText); cleanedText = tjShiftArray; } canvas.ShowText(cleanedText); } else { if (removedTextShift != null) { canvas.ShowText(tjShiftArray); } PdfCleanUpProcessor.WriteOperands(canvas, operands); } }