ABCpdf コンポーネントを使用して HTML ページを PDF に変換しようとしています。AddImagehtml メソッドを使用してそれを行いました。それは働いています。私の要件は、値を動的に取得することです。データセットから HTML に値を渡すにはどうすればよいですか。誰でも私の問題を解決できますか?
1572 次
2 に答える
1
stringbuilder Eg で HTML を動的に構築する
以下の疑似コード
String Builder SB = new StringBuilder()
// Initialize HTML here with head body, etc
SB.AppendLine("<table>");`
foreach datarow DR in DataTable`
{
// loop through columns and add them in TR TD tags
}
// Now build the PDF from the HTML
Doc thisPDF = New Doc();
Integer iChk = thisPDF.AddImageHtml(SB.ToString());
while thisPDF.Chainable(iChk)
{
thisPDF.Page = thisPDF.AddPage();
thisPDF.FrameRect();
iChk = thisPDF.AddImageToChain(iChk);
}
// Save the PDF here, or output to HTTP stream for user to download
于 2012-04-11T13:03:05.490 に答える
0
動的テーブルを作成し、データセットをループして値を追加するなど、他の方法を使用してサーバー側で動的に行う必要があると思います。
インストール フォルダにある ABC PDF ドキュメントの小さなテーブルの例と大きなテーブルの例を確認してください。
于 2012-03-05T10:46:36.377 に答える