Próbuję dodać tabelę do dokumentu za pomocą iTextSharp. Oto przykład:iTextSharp szerokość stołu 100% strony
Document document = new Document(PageSize.LETTER,72, 72, 72, 72);
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("C:\\test.pdf", FileMode.Create));
document.Open();
Table table = new Table (2, 1);
table.Width = document.RightMargin - document.LeftMargin;
// Cell placeholder
Cell cell = new Cell (new Paragraph ("Some Text"));
table.AddCell (cell);
cell = new Cell (new Paragraph ("More Text"));
table.AddCell (cell);
document.Add (table);
document.Close ();
Ustawiam szerokość stołu tak, aby rozszerzyć margines strony. Ale po utworzeniu pliku PDF tabela zajmuje tylko około 80% przestrzeni między marginesami. Czy robię coś niepoprawnie tutaj?
[5.5.9] TotalWidth nie jest statyczną wartością - jest to po prostu właściwość obiektu. – MaLiN2223