📜  itext7 pdfwriter outputstream c# 代码示例

📅  最后修改于: 2022-03-11 14:48:58.307000             🧑  作者: Mango

代码示例1
public byte[] CreatePdf()
    {
        var stream = new MemoryStream();
        var writer = new PdfWriter(stream);
        var pdf = new PdfDocument(writer);
        var document = new Document(pdf);

        document.Add(new Paragraph("Hello world!"));
        document.Close();

        return stream.ToArray();
    }