如何将字节数组加载到PDF文档中? [英] How do I load array of bytes into PDF document?
本文介绍了如何将字节数组加载到PDF文档中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图将字节数组加载到pdf文档中,但是我收到了一个错误,包含字母格式的数组,我需要在发送邮件之前以pdf格式预览。
我尝试过:
Im trying to load array of bytes into pdf document but I got an error, the array containing letter format which I need to preview in pdf before sending it in a mail.
What I have tried:
byte[] bytes = GetFileBytes(fileStream);
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 10f);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
//how should I load the bytes
pdfDoc.Close();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=preview.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Write(pdfDoc);
Response.End();
推荐答案
将字节数组转换为c#中的pdf [ ^ ]
这篇关于如何将字节数组加载到PDF文档中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文