private static void ShowDescription(HPdfPage page, float x, float y, string text) { string buf; page.MoveTo(x, y - 10); page.LineTo(x, y + 10); page.MoveTo(x - 10, y); page.LineTo(x + 10, y); page.Stroke(); page.SetFontAndSize(page.GetCurrentFont(), 8); page.SetRGBFill(0, 0, 0); page.BeginText(); buf = "(x=" + x + ",y=" + y + ")"; page.MoveTextPos(x - page.TextWidth(buf) - 5, y - 10); page.ShowText(buf); page.EndText(); page.BeginText(); page.MoveTextPos(x - 20, y - 25); page.ShowText(text); page.EndText(); }
private static void PrintPage(HPdfPage page, int page_num) { page.SetWidth(800); page.SetHeight(800); page.BeginText(); page.MoveTextPos(30, 740); string buf = "Page:" + page_num; page.ShowText(buf); page.EndText(); }
private static void ShowDescription (HPdfPage page, float x, float y, string text) { float fsize = page.GetCurrentFontSize(); HPdfFont font = page.GetCurrentFont(); HPdfRGBColor c = page.GetRGBFill(); page.BeginText(); page.SetRGBFill(0, 0, 0); page.SetTextRenderingMode(HPdfTextRenderingMode.HPDF_FILL); page.SetFontAndSize(font, 10); page.TextOut(x, y - 12, text); page.EndText(); page.SetFontAndSize(font, fsize); page.SetRGBFill(c.r, c.g, c.b); }
private static void DrawRect(HPdfPage page, float x, float y, string label) { page.BeginText(); page.MoveTextPos(x, y - 10); page.ShowText(label); page.EndText(); page.Rectangle(x, y - 40, 220, 25); }
private static void DrawLine2(HPdfPage page, float x, float y, string label) { page.BeginText(); page.MoveTextPos(x, y); page.ShowText(label); page.EndText(); page.MoveTo(x + 30, y - 25); page.LineTo(x + 160, y - 25); page.Stroke(); }
private static void PrintPage (HPdfPage page, string caption, HPdfFont font, HPdfTransitionStyle type, HPdfPage prev, HPdfPage next) { float r = (float)rand.Next(255) / 255; float g = (float)rand.Next(255) / 255; float b = (float)rand.Next(255) / 255; HPdfRect rect; HPdfDestination dst; HPdfAnnotation annot; page.SetWidth (800); page.SetHeight (600); page.SetRGBFill (r, g, b); page.Rectangle ( 0, 0, 800, 600); page.Fill (); page.SetRGBFill (1.0f - r, 1.0f - g, 1.0f - b); page.SetFontAndSize (font, 30); page.BeginText (); page.SetTextMatrix (0.8f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); page.TextOut (50, 530, caption); page.SetTextMatrix (1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); page.SetFontAndSize (font, 20); page.TextOut (55, 300, "Type \"Ctrl+L\" in order to return from full screen mode."); page.EndText (); page.SetSlideShow (type, 5.0f, 1.0f); page.SetFontAndSize (font, 20); if (next != null) { page.BeginText (); page.TextOut (680, 50, "Next=>"); page.EndText (); rect.left = 680; rect.right = 750; rect.top = 70; rect.bottom = 50; dst = next.CreateDestination(); dst.SetFit(); annot = page.CreateLinkAnnot (rect, dst); annot.SetBorderStyle (0, 0, 0); annot.SetHighlightMode (HPdfAnnotHighlightMode.HPDF_ANNOT_INVERT_BOX); } if (prev != null) { page.BeginText (); page.TextOut (50, 50, "<=Prev"); page.EndText (); rect.left = 50; rect.right = 110; rect.top = 70; rect.bottom = 50; dst = prev.CreateDestination(); dst.SetFit(); annot = page.CreateLinkAnnot (rect, dst); annot.SetBorderStyle (0, 0, 0); annot.SetHighlightMode (HPdfAnnotHighlightMode.HPDF_ANNOT_INVERT_BOX); } }