是否可以在vb.net中使用PDFsharp进行自动多页运算? (我在SQL表中有1000条记录,我想全部显示它们,但现在它只显示一页100页:P)
是的,我没有把我的代码放在这里..ukupnoNaslov = "Ukp."
graph.DrawString(ukupnoNaslov, font, XBrushes.Black,
New XRect(170, zPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
izasloDaNaslov = "DA"
graph.DrawString(izasloDaNaslov, font, XBrushes.Black,
New XRect(205, zPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
izasloNeNaslov = "NE"
graph.DrawString(izasloNeNaslov, font, XBrushes.Black,
New XRect(235, zPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
For i = 0 To ds.Tables(0).Rows.Count - 1
bm = "Biracko mesto: " & ds.Tables(0).Rows(i).Item(0)
ukupnoglasova = "| " & ds.Tables(0).Rows(i).Item(1)
izasloDA = ds.Tables(0).Rows(i).Item(2)
izasloNE = ds.Tables(0).Rows(i).Item(3)
graph.DrawString(bm, font, XBrushes.Black,
New XRect(40, yPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
graph.DrawString(ukupnoglasova, font, XBrushes.Black,
New XRect(180, yPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
graph.DrawString(izasloDA, font, XBrushes.Black,
New XRect(210, yPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
graph.DrawString(izasloNE, fontBold, XBrushes.Black,
New XRect(240, yPoint, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.TopLeft)
yPoint = yPoint + 15
Next
Dim pdfFilename As String = "D:\Statistika" & vreme & ".pdf"
pdf.Save(pdfFilename)
答案 0 :(得分:0)
MigraDoc附带PDFsharp。 MigraDoc使创建多页文档变得非常简单。 MigraDoc自动创建所需的页面。
PDFsharp是一个低级库,您必须跟踪页面上的位置并根据需要开始新页面。
C#样本:
http://pdfsharp.net/wiki/MigraDocSamples.ashx
VB.NET示例:
http://forum.pdfsharp.net/viewtopic.php?f=8&t=3207