public OutputVisitorResult Visit(OutputByteArray outputByteArray)
        {
            var fileName = _tempFileManager.CreateTempFile(content: null);

            return(new OutputVisitorResult()
            {
                OutputFile = fileName
            });
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }