NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Mon May 10, 2010 8:11 am Post subject: [c#]ItextSharp - problem with margins |
|
|
Hello all users.
When I try to make a pdf using itext the margin gets fucked up.
I have set the margins to .5 which should be the middle of the document but instead it's printed at middleleft wtf?`
| Code: | private void MasterButton_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "PDF (.pdf)|*.pdf";
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
slutdoc = new Document(PageSize.A4);
float LeftMargin = (float)(slutdoc.Left*.5);
float RightMargin = (float)(slutdoc.Right*.5);
float TopMargin = (float)(slutdoc.Top*.5);
float BottomMargin = (float)(slutdoc.Bottom*.5);
slutdoc.SetMargins(LeftMargin,RightMargin,TopMargin,BottomMargin);
savepdf(sfd.FileName, slutdoc);
slutdoc.Open();
slutdoc.Add(new Paragraph("HELLU W0RLD"));
slutdoc.Close();
}
} |
_________________
Intel over amd yes. |
|