/// <summary> /// Salva o DANFE em um stream. /// </summary> /// <param name="stream">Stream.</param> public void Salvar(System.IO.Stream stream) { VerificarGerado(); var pdfclowStream = new org.pdfclown.bytes.Stream(stream); _File.Save(pdfclowStream, org.pdfclown.files.SerializationModeEnum.Standard); }
protected Byte[] Serialize(org.pdfclown.files.File pdfFile) { using (MemoryStream stream = new MemoryStream()) { org.pdfclown.bytes.Stream pdfstream = new org.pdfclown.bytes.Stream(stream); pdfFile.Save(pdfstream, org.pdfclown.files.SerializationModeEnum.Incremental); return pdfstream.ToByteArray(); } }
public Byte[] ObterPdfBytes(System.IO.Stream stream) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } var pdfStrean = new org.pdfclown.bytes.Stream(stream); File.Save(pdfStrean, SerializationModeEnum.Incremental); return(pdfStrean.ToByteArray()); }
public void SaveByteToPdf(byte[] bytes, string src) { using (var ms = new MemoryStream(bytes)) { using (org.pdfclown.bytes.IInputStream stream = new org.pdfclown.bytes.Stream(ms)) { using (var file = new org.pdfclown.files.File(stream)) { file.Save(src, SerializationModeEnum.Standard); } } } }