本文整理匯總了C#中iTextSharp.text.pdf.PdfContentByte.MoveTo方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfContentByte.MoveTo方法的具體用法?C# PdfContentByte.MoveTo怎麽用?C# PdfContentByte.MoveTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfContentByte
的用法示例。
在下文中一共展示了PdfContentByte.MoveTo方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawTimeTable
// ---------------------------------------------------------------------------
/**
* Draws the time table for a day at the film festival.
* @param directcontent a canvas to which the time table has to be drawn.
*/
protected void DrawTimeTable(PdfContentByte directcontent)
{
directcontent.SaveState();
directcontent.SetLineWidth(1.2f);
float llx, lly, urx, ury;
llx = OFFSET_LEFT;
lly = OFFSET_BOTTOM;
urx = OFFSET_LEFT + WIDTH;
ury = OFFSET_BOTTOM + HEIGHT;
directcontent.MoveTo(llx, lly);
directcontent.LineTo(urx, lly);
directcontent.LineTo(urx, ury);
directcontent.LineTo(llx, ury);
directcontent.ClosePath();
directcontent.Stroke();
llx = OFFSET_LOCATION;
lly = OFFSET_BOTTOM;
urx = OFFSET_LOCATION + WIDTH_LOCATION;
ury = OFFSET_BOTTOM + HEIGHT;
directcontent.MoveTo(llx, lly);
directcontent.LineTo(urx, lly);
directcontent.LineTo(urx, ury);
directcontent.LineTo(llx, ury);
directcontent.ClosePathStroke();
directcontent.SetLineWidth(1);
directcontent.MoveTo(
OFFSET_LOCATION + WIDTH_LOCATION / 2, OFFSET_BOTTOM
);
directcontent.LineTo(
OFFSET_LOCATION + WIDTH_LOCATION / 2, OFFSET_BOTTOM + HEIGHT
);
float y;
for (int i = 1; i < LOCATIONS; i++)
{
y = OFFSET_BOTTOM + (i * HEIGHT_LOCATION);
if (i == 2 || i == 6)
{
directcontent.MoveTo(OFFSET_LOCATION, y);
directcontent.LineTo(OFFSET_LOCATION + WIDTH_LOCATION, y);
}
else
{
directcontent.MoveTo(OFFSET_LOCATION + WIDTH_LOCATION / 2, y);
directcontent.LineTo(OFFSET_LOCATION + WIDTH_LOCATION, y);
}
directcontent.MoveTo(OFFSET_LEFT, y);
directcontent.LineTo(OFFSET_LEFT + WIDTH, y);
}
directcontent.Stroke();
directcontent.RestoreState();
}
示例2: PdfFooter
private static PdfTemplate PdfFooter(PdfContentByte cb)
{
// Create the template and assign height
PdfTemplate tmpFooter = cb.CreateTemplate(580, 70);
// Move to the bottom left corner of the template
tmpFooter.MoveTo(1, 1);
// Place the footer content
tmpFooter.Stroke();
// Begin writing the footer
tmpFooter.BeginText();
// Set the font and size
tmpFooter.SetFontAndSize(_baseFont, 8);
// Write out details from the payee table
tmpFooter.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "De facturen zijn contant betaalbaar te Tielt of op rekeningnummer", cb.PdfWriter.PageSize.Width / 2, 45, 0);
tmpFooter.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "733-0318587-69 bij KBC of 001-6090654-03 bij BNP Paribas Fortis", cb.PdfWriter.PageSize.Width / 2, 35, 0);
tmpFooter.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "Alle klachten dienen binnen de 24 uren, na de uitgevoerde werken schriftelijk medegedeeld te worden.", cb.PdfWriter.PageSize.Width / 2, 25, 0);
tmpFooter.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "Bij geschillen is enkel de rechtbank van Brugge bevoegd.", cb.PdfWriter.PageSize.Width / 2, 15, 0);
// End text
tmpFooter.EndText();
// Stamp a line above the page footer
cb.SetLineWidth(0f);
cb.MoveTo(30, 60);
cb.LineTo(570, 60);
cb.Stroke();
// Return the footer template
return tmpFooter;
}
示例3: DrawLine
public void DrawLine(
PdfContentByte cb, float x1, float x2, float y
)
{
cb.MoveTo(x1, y);
cb.LineTo(x2, y);
cb.Stroke();
}
示例4: CreateStar
// ---------------------------------------------------------------------------
/**
* Creates a path for a five pointed star.
* This method doesn't fill or stroke the star!
* @param canvas the canvas for which the star is constructed
* @param x the X coordinate of the center of the star
* @param y the Y coordinate of the center of the star
*/
public static void CreateStar(PdfContentByte canvas, float x, float y)
{
canvas.MoveTo(x + 10, y);
canvas.LineTo(x + 80, y + 60);
canvas.LineTo(x, y + 60);
canvas.LineTo(x + 70, y);
canvas.LineTo(x + 40, y + 90);
canvas.ClosePath();
}
示例5: CreateCircle
// ---------------------------------------------------------------------------
/**
* Creates a path for circle using Bezier curvers.
* The path can be constructed clockwise or counter-clockwise.
* This method doesn't Fill or stroke the circle!
* @param canvas the canvas for which the path is constructed
* @param x the X coordinate of the center of the circle
* @param y the Y coordinate of the center of the circle
* @param r the radius
* @param clockwise true if the circle has to be constructed clockwise
*/
public static void CreateCircle(PdfContentByte canvas, float x, float y,
float r, bool clockwise)
{
float b = 0.5523f;
if (clockwise) {
canvas.MoveTo(x + r, y);
canvas.CurveTo(x + r, y - r * b, x + r * b, y - r, x, y - r);
canvas.CurveTo(x - r * b, y - r, x - r, y - r * b, x - r, y);
canvas.CurveTo(x - r, y + r * b, x - r * b, y + r, x, y + r);
canvas.CurveTo(x + r * b, y + r, x + r, y + r * b, x + r, y);
} else {
canvas.MoveTo(x + r, y);
canvas.CurveTo(x + r, y + r * b, x + r * b, y + r, x, y + r);
canvas.CurveTo(x - r * b, y + r, x - r, y + r * b, x - r, y);
canvas.CurveTo(x - r, y - r * b, x - r * b, y - r, x, y - r);
canvas.CurveTo(x + r * b, y - r, x + r, y - r * b, x + r, y);
}
}
示例6: DirectDrawReport
private void DirectDrawReport(PdfContentByte canvas)
{
//畫線
canvas.SaveState();
canvas.SetLineWidth(2f);
canvas.MoveTo(100, 100);
canvas.LineTo(200, 200);
canvas.Stroke();
canvas.RestoreState();
//文本
ColumnText.ShowTextAligned(canvas, Element.ALIGN_RIGHT, new Phrase("JulyLuo測試", new Font(BF_Light, 10)), 100, 20, 0);
}
示例7: Render_BackBase
private static void Render_BackBase(PdfContentByte under)
{
// Y relative to card top, line width, <repeat>
float[] measures = new[] { 37, 3f, 144, 1.5f };
under.SaveState();
for (int i = 0; i < measures.Length / 2; i++)
{
under.SetLineWidth(measures[i * 2 + 1]);
under.MoveTo(0, CARD_HEIGHT - measures[i * 2]);
under.LineTo(CARD_WIDTH, CARD_HEIGHT - measures[i * 2]);
under.Stroke();
}
under.SetFontAndSize(baseFont, 7);
under.ShowTextAlignedKerned(Element.ALIGN_CENTER, "If found, please call KCSAR at (206) 205-8226", CARD_WIDTH / 2, 7, 0);
under.RestoreState();
}
示例8: createBezierCurves
// ---------------------------------------------------------------------------
/**
* Draws a series of Bezier curves
* @param cb the canvas to which the curves have to be drawn
* @param x0 X coordinate of the start point
* @param y0 Y coordinate of the start point
* @param x1 X coordinate of the first control point
* @param y1 Y coordinate of the first control point
* @param x2 X coordinate of the second control point
* @param y2 Y coordinate of the second control point
* @param x3 X coordinate of the end point
* @param y3 Y coordinate of the end point
* @param distance the distance between the curves
*/
public void createBezierCurves(PdfContentByte cb, float x0, float y0,
float x1, float y1, float x2, float y2, float x3,
float y3, float distance)
{
cb.MoveTo(x0, y0);
cb.LineTo(x1, y1);
cb.MoveTo(x2, y2);
cb.LineTo(x3, y3);
cb.MoveTo(x0, y0);
cb.CurveTo(x1, y1, x2, y2, x3, y3);
x0 += distance;
x1 += distance;
x2 += distance;
x3 += distance;
cb.MoveTo(x2, y2);
cb.LineTo(x3, y3);
cb.MoveTo(x0, y0);
cb.CurveTo(x2, y2, x3, y3);
x0 += distance;
x1 += distance;
x2 += distance;
x3 += distance;
cb.MoveTo(x0, y0);
cb.LineTo(x1, y1);
cb.MoveTo(x0, y0);
cb.CurveTo(x1, y1, x3, y3);
cb.Stroke();
}
示例9: AddColoredRectangle
private void AddColoredRectangle(PdfContentByte canvas, PdfCleanUpLocation cleanUpLocation) {
Rectangle cleanUpRegion = cleanUpLocation.Region;
canvas.SaveState();
canvas.SetColorFill(cleanUpLocation.CleanUpColor);
canvas.MoveTo(cleanUpRegion.Left, cleanUpRegion.Bottom);
canvas.LineTo(cleanUpRegion.Right, cleanUpRegion.Bottom);
canvas.LineTo(cleanUpRegion.Right, cleanUpRegion.Top);
canvas.LineTo(cleanUpRegion.Left, cleanUpRegion.Top);
canvas.ClosePath();
canvas.Fill();
canvas.RestoreState();
}
示例10: Open
public bool Open(PdfContentByte cb, float fontSize, float xtlm, float ytlm)
{
if (!_isPrevEmDash)
{
var padding = fontSize * _emDashPaddingRatio;
cb.EndText();
cb.SetLineWidth(_lineWidth);
cb.MoveTo(xtlm, ytlm - padding);
_isPrevEmDash = true;
return true;
}
else
{
return false;
}
}
示例11: DrawLine
/**
* Draws a horizontal line.
* @param canvas the canvas to draw on
* @param leftX the left x coordinate
* @param rightX the right x coordindate
* @param y the y coordinate
*/
public void DrawLine(PdfContentByte canvas, float leftX, float rightX, float y)
{
float w;
if (Percentage < 0)
w = -Percentage;
else
w = (rightX - leftX) * Percentage / 100.0f;
float s;
switch (Alignment) {
case Element.ALIGN_LEFT:
s = 0;
break;
case Element.ALIGN_RIGHT:
s = rightX - leftX - w;
break;
default:
s = (rightX - leftX - w) / 2;
break;
}
canvas.SetLineWidth(LineWidth);
if (LineColor != null)
canvas.SetColorStroke(LineColor);
canvas.MoveTo(s + leftX, y + offset);
canvas.LineTo(s + w + leftX, y + offset);
canvas.Stroke();
}
示例12: DrawBoxForCover
/// <summary>
/// Draws the box on the cover page that contains the date
/// </summary>
/// <param name="cb"></param>
/// <param name="doc"></param>
/// <param name="project"></param>
private void DrawBoxForCover(PdfContentByte cb, Document doc)
{
// set the colors
cb.SetColorStroke(_baseColor);
cb.SetColorFill(_baseColor);
// calculate the top left corner of the box
var x = doc.LeftMargin;
var y = doc.BottomMargin + 678;
var height = 60;
// move the cursor to starting position
cb.MoveTo(x, y);
// draw the top line
cb.LineTo(x + _pageWidth, y);
// draw the right line
cb.LineTo(x + _pageWidth, y - height);
// draw the bottom line
cb.LineTo(x, y - height);
// draw the left line
cb.LineTo(x, y);
cb.ClosePathFillStroke();
cb.Stroke();
// add the text inside the box
cb.BeginText();
cb.SetFontAndSize(_dateBaseFont, 26f);
cb.SetColorStroke(BaseColor.WHITE);
cb.SetColorFill(BaseColor.WHITE);
cb.SetTextMatrix(x + 10, y - 40);
cb.ShowText(string.Format("{0:MMMM dd, yyyy}", DateTime.Now));
cb.EndText();
}
示例13: Draw
protected override void Draw(PdfContentByte cb)
{
cb.MoveTo(x1, y1);
cb.LineTo(x2, y2);
}
示例14: LineTimeAndLead
private void LineTimeAndLead(PdfContentByte cb)
{
YPos -= 1;
//Top Border Line
cb.MoveTo(XBeginningPos, YPos);
cb.LineTo(XEndPos, YPos);
cb.Stroke();
//Time: & Lead: Text
TimeLeadText(cb);
//Bottom Border Line
YPos -= 46;
cb.MoveTo(XBeginningPos, YPos);
cb.LineTo(XEndPos, YPos);
cb.Stroke();
YPos -= 106;
}
示例15: DrawDiamont
/// <summary>
/// Draws the diamont.
/// </summary>
/// <param name="content">The content.</param>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
public static void DrawDiamont(PdfContentByte content, float x, float y)
{
content.SaveState();
var state = new PdfGState();
content.SetGState(state);
content.SetColorFill(BaseColor.BLACK);
content.MoveTo(x, y);
var sPoint = new Point(x, y);
var uMPoint = new Point(x + WPosMarkerMid, y + HPosMarkerMid);
var rPoint = new Point(uMPoint.X + WPosMarkerMid, uMPoint.Y - HPosMarkerMid);
var mPoint = new Point(rPoint.X - WPosMarkerMid, rPoint.Y - HPosMarkerMid);
DrawLines(content, uMPoint, rPoint, mPoint, sPoint);
content.ClosePathFillStroke();
content.RestoreState();
}