简体   繁体   中英

Accepting Pdf through post request and passing to itext7 pdfreader in c# .net core

I am getting a pdf through post request from frontend as an IFormFile form and I want to take that and pass it to pdfreader() in itext7 package. so far i could only pass with the path as string i dont have any path to specify.

Pdfreader accepts System.IO.MemoryStream , or any generic System.IO.Stream , as can be seen in the API documentation: https://api.itextpdf.com/iText7/dotnet/7.1.11/classi_text_1_1_kernel_1_1_pdf_1_1_pdf_reader.html

PdfReader (IRandomAccessSource byteSource, ReaderProperties properties)
Constructs a new PdfReader. More...

PdfReader (Stream @is, ReaderProperties properties)
Reads and parses a PDF document. More...

PdfReader (FileInfo file)
Reads and parses a PDF document. More...

PdfReader (Stream @is)
Reads and parses a PDF document. More...

PdfReader (String filename, ReaderProperties properties)
Reads and parses a PDF document. More...

PdfReader (String filename)
Reads and parses a PDF document. More...

So you can pass the data from the IFormFile form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM