iTextSharp.tool.xml.XMLWorkerHelper.GetInstance().ParseXHtml not working

前端 未结 1 455
[愿得一人]
[愿得一人] 2021-01-20 00:48

I\'m using iTextSharp version: 5.5.6; iTextSharp XML Worker version: 5.5.6

I got some code from Here, but after I run the code, the PDF file will never open

<
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 01:41

    (as discovered through the comments)

    You need to call doc.Close() before calling buf = memStream.ToArray();. This let's iTextSharp know that you are actually done and it should flush any buffers and write the PDF trailer.

    0 讨论(0)
提交回复
热议问题