我在生成PDF格式的條形碼時遇到了麻煩。我正在使用itextsharp生成PDF和我有數據庫生成這個,我不熟悉條形碼...請幫我生成條形碼.....使用itextsharp生成PDF時生成條形碼pdf
我用下面的代碼.. HttpContext。 Current.Response.ContentType =「application/pdf」 HttpContext.Current.Response.AddHeader(「content-disposition」,「attachment; filename = GridViewExport.pdf」) HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache )
Dim pdfDoc As New Document()
PdfWriter.GetInstance(pdfDoc, HttpContext.Current.Response.OutputStream)
pdfDoc.Open()
'WRITE PDF <<<<<<
pdfDoc.Add(New Paragraph("My first PDF"))
'END WRITE PDF >>>>>
pdfDoc.Close()
HttpContext.Current.Response.Write(pdfDoc)
HttpContext.Current.Response.End()
問候,
Sivajith S.
建議您使用要插入PDF文件的條形碼的光柵圖像。這並不總是最好的選擇。在iTextSharp中使用本地條形碼功能時,圖像將作爲矢量數據添加,這使得打印圖像比使用光柵圖像更加可靠。 –
這是有道理的。我贊成你的答案。 –