embedded content is not posted back to the server.
the user would need to save the pdf to a local file, and you would need to supply a
<input type="file" name="theFile">
in your form so they could select the saved file and upload.
this is probably not what you wanted. You need a javascript library that supports displaying and form filling a pdf file. there is a common free choice:
None
0 Points
2 Posts
How to open Pdf in Browser and Save as Pdf file in Folder in Asp.net mvc
Feb 08, 2021 06:35 PM|SangJin|LINK
I want to use opening Pdf file, and User input some of fields, and then save as this file into Specific folder in my Asp.net folder.
I try to use HttpPostedFileBase file but I cannot save this file to folder, always become null for Parameter.
<form method="post" enctype="multipart/form-data">
<div>
<embed name="file" src="~/AnnounceFile/PDF.pdf#toolbar=0&navpanes=0&scrollbar=0" style="width: 780px; height: 980px;" class="with-200" />
<button type="submit">Import</button>
</div>
</form>
Controller
[HttpPost]
public ActionResult Index(HttpPostedFileBase file)
{
string filename = Guid.NewGuid() + Path.GetExtension(file.FileName);
string filepath = "/excelfolder/" + filename;
file.SaveAs(Path.Combine(Server.MapPath("/excelfolder"), filename));
InsertExceldata(filepath, filename);
return View(db.Iteminfoes.ToList());
All-Star
58234 Points
15673 Posts
Re: How to open Pdf in Browser and Save as Pdf file in Folder in Asp.net mvc
Feb 08, 2021 11:28 PM|bruce (sqlwork.com)|LINK
embedded content is not posted back to the server.
the user would need to save the pdf to a local file, and you would need to supply a
<input type="file" name="theFile">
in your form so they could select the saved file and upload.
this is probably not what you wanted. You need a javascript library that supports displaying and form filling a pdf file. there is a common free choice:
https://github.com/mozilla/pdf.js
there are other options, google
javascript pdf interactive form
javascript pdf fillable form