本文整理匯總了C#中iTextSharp.text.pdf.PdfString.ToUnicodeString方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfString.ToUnicodeString方法的具體用法?C# PdfString.ToUnicodeString怎麽用?C# PdfString.ToUnicodeString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfString
的用法示例。
在下文中一共展示了PdfString.ToUnicodeString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DecodeString
private String DecodeString(PdfString ps) {
if (ps.IsHexWriting())
return PdfEncodings.ConvertToString(ps.GetBytes(), "UnicodeBigUnmarked");
else
return ps.ToUnicodeString();
}
示例2: DrawOverlayText
private void DrawOverlayText(PdfContentByte canvas, IList<Rectangle> textRectangles, PdfString overlayText,
PdfString otDA, PdfNumber otQ, PdfBoolean otRepeat) {
ColumnText ct = new ColumnText(canvas);
ct.SetLeading(0, 1.2F);
ct.UseAscender = true;
String otStr = overlayText.ToUnicodeString();
canvas.SaveState();
IDictionary<string, IList<object>> parsedDA = ParseDAParam(otDA);
Font font = null;
if (parsedDA.ContainsKey(STROKE_COLOR)) {
IList<object> strokeColorArgs = parsedDA[STROKE_COLOR];
SetStrokeColor(canvas, strokeColorArgs);
}
if (parsedDA.ContainsKey(FILL_COLOR)) {
IList<object> fillColorArgs = parsedDA[FILL_COLOR];
SetFillColor(canvas, fillColorArgs);
}
if (parsedDA.ContainsKey("Tf")) {
IList<object> tfArgs = parsedDA["Tf"];
font = RetrieveFontFromAcroForm((PdfName) tfArgs[0], (PdfNumber) tfArgs[1]);
}
foreach (Rectangle textRect in textRectangles) {
ct.SetSimpleColumn(textRect);
if (otQ != null) {
ct.Alignment = otQ.IntValue;
}
Phrase otPhrase;
if (font != null) {
otPhrase = new Phrase(otStr, font);
} else {
otPhrase = new Phrase(otStr);
}
float y = ct.YLine;
if (otRepeat != null && otRepeat.BooleanValue) {
int status = ct.Go(true);
while (!ColumnText.HasMoreText(status)) {
otPhrase.Add(otStr);
ct.SetText(otPhrase);
ct.YLine = y;
status = ct.Go(true);
}
}
ct.SetText(otPhrase);
ct.YLine = y;
ct.Go();
}
canvas.RestoreState();
}