本文整理匯總了C#中iTextSharp.text.pdf.PdfPTable.AddCentered方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfPTable.AddCentered方法的具體用法?C# PdfPTable.AddCentered怎麽用?C# PdfPTable.AddCentered使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PdfPTable
的用法示例。
在下文中一共展示了PdfPTable.AddCentered方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ContactForm
public void ContactForm()
{
doc.NewPage();
var t = new PdfPTable(1);
t.SetNoBorder();
t.AddCentered("InReach/Outreach Card", 1, h1font);
t.AddCentered("Contact Summary", 1, h2font);
t.AddRight("Contact Date: _______________", bfont);
doc.Add(t);
DisplayTable("Contact Reason", 5.7f, 1.2f, 24f, new List<string>
{
"Out-Reach (not a church member)",
"In-Reach (church/group member)",
"Information",
"Bereavement",
"Health",
"Personal",
"Other"
});
DisplayTable("Type of Contact", 5.7f, 8f, 24f, new List<string>
{
"Personal Visit",
"Phone Call",
"Card Sent",
"Email Sent",
});
DisplayTable("Results", 5.7f, 14.5f, 24f, new List<string>
{
"Not at Home",
"Left Door Hanger",
"Left Message",
"Contact Made",
"Gospel Shared",
"Profession of Faith",
"Prayer Request Rec'd",
"Prayed for Person",
"Already Saved",
});
DisplayNotes("Team Members", 4, 7.5f, 6f, 18.5f);
DisplayNotes("Specific Comments on Contact", 5, 18.5f, 1.2f, 13f);
DisplayTable("Actions to be taken", 12f, 1f, 6.5f, new List<string>
{
"Recycle to me on ____/____/____",
"Random Recycle",
"Follow-up Completed",
});
var t2 = new PdfPTable(1);
t2.TotalWidth = 7.5f * 72f;
t2.SetNoBorder();
t2.LockedWidth = true;
t2.AddCentered("Internal Use Only", 1, smallfont);
t2.WriteSelectedRows(0, -1, 36f, 56f, dc);
}
示例2: ContactForm
public void ContactForm(ProspectInfo p)
{
/* There is no look up table for Contact Results because they are hardcoded into the form for actually adding a contact to a record
* Another Setting is used to allow for customization of the blank Contact Form. It is called "ContactFormResults"
* The code takes a semi-colon seperated string stored in ContactFormResults and converts it to a list.
* If ContactFormResults does not exist in Settings then the default list is used.
*
* However, because the results are hardcoded, there will be no translation between the results on this form and the results on the Contact page itself.
* We will implement extra values for this table to accomodate this at some point.
* */
var Db = DbUtil.Db;
List<string> ContactResult =
Db.Setting(
"ContactFormResults",
"Not at Home;Left Door Hanger;Left Message;Contact Made;Gospel Shared;Profession of Faith;Prayer Request Rec'd;Prayed for Person;Already Saved"
).Split(';').ToList();
doc.NewPage();
var t = new PdfPTable(2);
t.SetNoBorder();
t.AddCentered("InReach/Outreach Card for {0} ({1})".Fmt(p.Name, p.PeopleId), 2, h1font);
t.AddCentered("Contact Summary", 2, h2font);
/* Added line for noting the Ministry recording the contact*/
t.AddLeft("Ministry: ______________________", 1, bfont);
t.AddRight("Contact Date: _______________", 1, bfont);
doc.Add(t);
var ContactReason = Db.ContactReasons.Select(rr => rr.Description).Take(10).ToList();
var ContactType = Db.ContactTypes.Select(rr => rr.Description).Take(10).ToList();
DisplayTable("Contact Reason", 5.7f, 1.2f, 24.2f, ContactReason);
DisplayTable("Type of Contact", 5.7f, 8f, 24.2f, ContactType);
DisplayTable("Results", 5.7f, 14.5f, 24.2f, ContactResult);
DisplayNotes("Team Members", 3, 6f, 13.7f, 6.5f);
DisplayNotes("Specific Comments on Contact", 5, 18.5f, 1.2f, 13f);
DisplayTable("Actions to be taken", 12f, 1f, 6.5f, new List<string>
{
"Recycle to me on ____/____/____",
"Random Recycle",
"Follow-up Completed",
"Other Action:___________________________________",
});
var t2 = new PdfPTable(1);
t2.TotalWidth = 7.5f * 72f;
t2.SetNoBorder();
t2.LockedWidth = true;
t2.AddCentered("Internal Use Only", 1, smallfont);
t2.WriteSelectedRows(0, -1, 36f, 56f, dc);
}
示例3: ExecuteResult
public override void ExecuteResult(ControllerContext context)
{
var Response = context.HttpContext.Response;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "filename=foo.pdf");
doc = new Document(PageSize.LETTER, 36, 36, 36, 36);
var w = PdfWriter.GetInstance(doc, Response.OutputStream);
doc.Open();
dc = w.DirectContent;
doc.NewPage();
var t = new PdfPTable(1);
t.SetNoBorder();
t.AddCentered("In-Reach/Outreach Card", 1, h1font);
t.AddCentered("Contact Summary", 1, h2font);
t.AddRight("Contact Date: _______________", bfont);
doc.Add(t);
DisplayTable("Contact Reason", 5.7f, 1.2f, 24f, new List<string>
{
"Out-Reach (not a church member)",
"In-Reach (church/group member)",
"Information",
"Bereavement",
"Health",
"Personal",
"Other"
});
DisplayTable("Type of Contact", 5.7f, 8f, 24f, new List<string>
{
"Personal Visit",
"Phone Call",
"Card Sent",
"Email Sent",
});
DisplayTable("Results", 5.7f, 14.5f, 24f, new List<string>
{
"Not at Home",
"Left Door Hanger",
"Left Message",
"Contact Made",
"Gospel Shared",
"Profession of Faith",
"Prayer Request Rec'd",
"Prayed for Person",
"Already Saved",
});
DisplayNotes("Team Members", 4, 7.5f, 6f, 18.5f);
DisplayNotes("Specific Comments on Contact", 5, 18.5f, 1.2f, 13f);
DisplayTable("Actions to be taken", 12f, 1f, 6.5f, new List<string>
{
"Recycle to me on ____/____/____",
"Random Recycle",
"Follow-up Completed",
});
var t2 = new PdfPTable(1);
t2.TotalWidth = 7.5f * 72f;
t2.SetNoBorder();
t2.LockedWidth = true;
t2.AddCentered("Internal Use Only", 1, smallfont);
t2.WriteSelectedRows(0, -1, 36f, 46f, dc);
doc.Close();
}