本文整理匯總了C#中iTextSharp.text.pdf.PdfContentByte.ResetRGBColorFill方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfContentByte.ResetRGBColorFill方法的具體用法?C# PdfContentByte.ResetRGBColorFill怎麽用?C# PdfContentByte.ResetRGBColorFill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfContentByte
的用法示例。
在下文中一共展示了PdfContentByte.ResetRGBColorFill方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FinishShape
protected static void FinishShape (PdfContentByte contentByte)
{
contentByte.FillStroke();
contentByte.ResetRGBColorFill();
}
示例2: WriteLineToContent
//.........這裏部分代碼省略.........
text.SetLineWidth(strokeWidth);
strokeColor = (BaseColor)textRender[2];
if (strokeColor == null)
strokeColor = color;
if (strokeColor != null)
text.SetColorStroke(strokeColor);
}
}
if (fr != null)
rise = (float)fr;
if (color != null)
text.SetColorFill(color);
if (rise != 0)
text.SetTextRise(rise);
if (chunk.IsImage()) {
adjustMatrix = true;
}
else if (chunk.IsHorizontalSeparator()) {
PdfTextArray array = new PdfTextArray();
array.Add(-glueWidth * 1000f / chunk.Font.Size / hScale);
text.ShowText(array);
}
else if (chunk.IsTab() && tabPosition != xMarker)
{
PdfTextArray array = new PdfTextArray();
array.Add((tabPosition - xMarker) * 1000f / chunk.Font.Size / hScale);
text.ShowText(array);
}
// If it is a CJK chunk or Unicode TTF we will have to simulate the
// space adjustment.
else if (isJustified && numberOfSpaces > 0 && chunk.IsSpecialEncoding()) {
if (hScale != lastHScale) {
lastHScale = hScale;
text.SetWordSpacing(baseWordSpacing / hScale);
text.SetCharacterSpacing(baseCharacterSpacing / hScale + text.CharacterSpacing);
}
String s = chunk.ToString();
int idx = s.IndexOf(' ');
if (idx < 0)
text.ShowText(s);
else {
float spaceCorrection = - baseWordSpacing * 1000f / chunk.Font.Size / hScale;
PdfTextArray textArray = new PdfTextArray(s.Substring(0, idx));
int lastIdx = idx;
while ((idx = s.IndexOf(' ', lastIdx + 1)) >= 0) {
textArray.Add(spaceCorrection);
textArray.Add(s.Substring(lastIdx, idx - lastIdx));
lastIdx = idx;
}
textArray.Add(spaceCorrection);
textArray.Add(s.Substring(lastIdx));
text.ShowText(textArray);
}
}
else {
if (isJustified && hScale != lastHScale) {
lastHScale = hScale;
text.SetWordSpacing(baseWordSpacing / hScale);
text.SetCharacterSpacing(baseCharacterSpacing / hScale + text.CharacterSpacing);
}
text.ShowText(chunk.ToString());
}
if (rise != 0)
text.SetTextRise(0);
if (color != null)
text.ResetRGBColorFill();
if (tr != PdfContentByte.TEXT_RENDER_MODE_FILL)
text.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
if (strokeColor != null)
text.ResetRGBColorStroke();
if (strokeWidth != 1)
text.SetLineWidth(1);
if (chunk.IsAttribute(Chunk.SKEW) || chunk.IsAttribute(Chunk.HSCALE)) {
adjustMatrix = true;
text.SetTextMatrix(xMarker, yMarker);
}
if (chunk.IsAttribute(Chunk.CHAR_SPACING)) {
text.SetCharacterSpacing(baseCharacterSpacing);
}
if (chunk.IsAttribute(Chunk.WORD_SPACING)) {
text.SetWordSpacing(baseWordSpacing);
}
if (IsTagged(writer) && chunk.accessibleElement != null) {
text.CloseMCBlock(chunk.accessibleElement);
}
}
if (isJustified) {
text.SetWordSpacing(0);
text.SetCharacterSpacing(0);
if (line.NewlineSplit)
lastBaseFactor = 0;
}
if (adjustMatrix)
text.MoveText(baseXMarker - text.XTLM, 0);
currentValues[0] = currentFont;
currentValues[1] = lastBaseFactor;
return lastX;
}
示例3: WriteLine
internal void WriteLine(PdfLine line, PdfContentByte text, PdfContentByte graphics) {
PdfFont currentFont = null;
foreach(PdfChunk chunk in line) {
if (chunk.Font.CompareTo(currentFont) != 0) {
currentFont = chunk.Font;
text.SetFontAndSize(currentFont.Font, currentFont.Size);
}
BaseColor color = chunk.Color;
if (color != null)
text.SetColorFill(color);
text.ShowText(chunk.ToString());
if (color != null)
text.ResetRGBColorFill();
}
}
示例4: WriteLine
internal void WriteLine(PdfLine line, PdfContentByte text, PdfContentByte graphics)
{
PdfFont currentFont = null;
foreach(PdfChunk chunk in line) {
if (chunk.Font.CompareTo(currentFont) != 0) {
currentFont = chunk.Font;
text.SetFontAndSize(currentFont.Font, currentFont.Size);
}
Object[] textRender = (Object[])chunk.GetAttribute(Chunk.TEXTRENDERMODE);
int tr = 0;
float strokeWidth = 1;
BaseColor color = chunk.Color;
BaseColor strokeColor = null;
if (textRender != null) {
tr = (int)textRender[0] & 3;
if (tr != PdfContentByte.TEXT_RENDER_MODE_FILL)
text.SetTextRenderingMode(tr);
if (tr == PdfContentByte.TEXT_RENDER_MODE_STROKE || tr == PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE) {
strokeWidth = (float)textRender[1];
if (strokeWidth != 1)
text.SetLineWidth(strokeWidth);
strokeColor = (BaseColor)textRender[2];
if (strokeColor == null)
strokeColor = color;
if (strokeColor != null)
text.SetColorStroke(strokeColor);
}
}
object charSpace = chunk.GetAttribute(Chunk.CHAR_SPACING);
// no char space setting means "leave it as is".
if (charSpace != null && !curCharSpace.Equals(charSpace)) {
curCharSpace = (float)charSpace;
text.SetCharacterSpacing(curCharSpace);
}
if (color != null)
text.SetColorFill(color);
text.ShowText(chunk.ToString());
if (color != null)
text.ResetRGBColorFill();
if (tr != PdfContentByte.TEXT_RENDER_MODE_FILL)
text.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
if (strokeColor != null)
text.ResetRGBColorStroke();
if (strokeWidth != 1)
text.SetLineWidth(1);
}
}
示例5: WriteLine
internal void WriteLine(PdfLine line, PdfContentByte text, PdfContentByte graphics)
{
PdfFont currentFont = null;
foreach(PdfChunk chunk in line) {
if (chunk.Font.CompareTo(currentFont) != 0) {
currentFont = chunk.Font;
text.SetFontAndSize(currentFont.Font, currentFont.Size);
}
BaseColor color = chunk.Color;
object charSpace = chunk.GetAttribute(Chunk.CHAR_SPACING);
// no char space setting means "leave it as is".
if (charSpace != null && !curCharSpace.Equals(charSpace)) {
curCharSpace = (float)charSpace;
text.SetCharacterSpacing(curCharSpace);
}
if (color != null)
text.SetColorFill(color);
text.ShowText(chunk.ToString());
if (color != null)
text.ResetRGBColorFill();
}
}
示例6: Reset
private static void Reset(PdfContentByte cb)
{
cb.SetLineWidth(1);
cb.ResetCMYKColorFill();
cb.ResetCMYKColorStroke();
cb.ResetGrayFill();
cb.ResetGrayStroke();
cb.ResetRGBColorFill();
cb.ResetRGBColorStroke();
}
示例7: WriteLineToContent
//.........這裏部分代碼省略.........
}
xMarker += width;
++chunkStrokeIdx;
}
if (chunk.Font.CompareTo(currentFont) != 0) {
currentFont = chunk.Font;
text.SetFontAndSize(currentFont.Font, currentFont.Size);
}
float rise = 0;
Object[] textRender = (Object[])chunk.GetAttribute(Chunk.TEXTRENDERMODE);
int tr = 0;
float strokeWidth = 1;
Color strokeColor = null;
object fr = chunk.GetAttribute(Chunk.SUBSUPSCRIPT);
if (textRender != null) {
tr = (int)textRender[0] & 3;
if (tr != PdfContentByte.TEXT_RENDER_MODE_FILL)
text.SetTextRenderingMode(tr);
if (tr == PdfContentByte.TEXT_RENDER_MODE_STROKE || tr == PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE) {
strokeWidth = (float)textRender[1];
if (strokeWidth != 1)
text.SetLineWidth(strokeWidth);
strokeColor = (Color)textRender[2];
if (strokeColor == null)
strokeColor = color;
if (strokeColor != null)
text.SetColorStroke(strokeColor);
}
}
if (fr != null)
rise = (float)fr;
if (color != null)
text.SetColorFill(color);
if (rise != 0)
text.SetTextRise(rise);
if (chunk.IsImage()) {
adjustMatrix = true;
}
// If it is a CJK chunk or Unicode TTF we will have to simulate the
// space adjustment.
else if (isJustified && numberOfSpaces > 0 && chunk.IsSpecialEncoding()) {
if (hScale != lastHScale) {
lastHScale = hScale;
text.SetWordSpacing(baseWordSpacing / hScale);
text.SetCharacterSpacing(baseCharacterSpacing / hScale);
}
String s = chunk.ToString();
int idx = s.IndexOf(' ');
if (idx < 0)
text.ShowText(chunk.ToString());
else {
float spaceCorrection = - baseWordSpacing * 1000f / chunk.Font.Size / hScale;
PdfTextArray textArray = new PdfTextArray(s.Substring(0, idx));
int lastIdx = idx;
while ((idx = s.IndexOf(' ', lastIdx + 1)) >= 0) {
textArray.Add(spaceCorrection);
textArray.Add(s.Substring(lastIdx, idx - lastIdx));
lastIdx = idx;
}
textArray.Add(spaceCorrection);
textArray.Add(s.Substring(lastIdx));
text.ShowText(textArray);
}
}
else {
if (isJustified && hScale != lastHScale) {
lastHScale = hScale;
text.SetWordSpacing(baseWordSpacing / hScale);
text.SetCharacterSpacing(baseCharacterSpacing / hScale);
}
text.ShowText(chunk.ToString());
}
if (rise != 0)
text.SetTextRise(0);
if (color != null)
text.ResetRGBColorFill();
if (tr != PdfContentByte.TEXT_RENDER_MODE_FILL)
text.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
if (strokeColor != null)
text.ResetRGBColorStroke();
if (strokeWidth != 1)
text.SetLineWidth(1);
if (chunk.IsAttribute(Chunk.SKEW) || chunk.IsAttribute(Chunk.HSCALE)) {
adjustMatrix = true;
text.SetTextMatrix(xMarker, yMarker);
}
}
if (isJustified) {
text.SetWordSpacing(0);
text.SetCharacterSpacing(0);
if (line.NewlineSplit)
lastBaseFactor = 0;
}
if (adjustMatrix)
text.MoveText(baseXMarker - text.XTLM, 0);
currentValues[0] = currentFont;
currentValues[1] = lastBaseFactor;
}