public OutputVisitorResult Visit(OutputByteArray outputByteArray) { var fileName = _tempFileManager.CreateTempFile(content: null); return(new OutputVisitorResult() { OutputFile = fileName }); }
public byte[] GeneratePdf(string htmlContent, string coverHtml) { var inputData = new InputHtmlString() { HtmlString = htmlContent }; var outputData = new OutputByteArray(); GeneratePdfInternal(new IInputData[] { inputData }, outputData, coverHtml: coverHtml, parameterManager: this); return(outputData.ByteArr); }
public OutputVisitorResult Visit(OutputByteArray outputByteArray) { using (var outputStream = new MemoryStream()) { using (FileStream fileStream = new FileStream(_resultFileName, FileMode.Open, FileAccess.Read, FileShare.Read)) this.CopyStream((Stream)fileStream, outputStream, 65536); outputByteArray.ByteArr = outputStream.ToArray(); } return(null); }
public byte[] GeneratePdfFromFile(string htmlFilePath, string coverHtml) { var inputData = new InputFile() { File = htmlFilePath }; var outputData = new OutputByteArray(); GeneratePdfInternal(new IInputData[] { inputData }, outputData, coverHtml, this); return(outputData.ByteArr); }