I am submitting a PDF file to my .NET CORE back-end.
The PDF was created using iText 7. I have added to the page few paragraphs and a PdfButtonFormField button with the following action
button.SetAction(PdfAction.CreateSubmitForm("http://localhost:4200/api/PdfSign/UploadPdfForSign", null, PdfAction.SUBMIT_PDF));
My endpoint gets the request. It looks like the request body has the binary data of the file but I have no idea how to read it.
Any help will be much appreciated!
** EDIT **
The goal is to get a PDF and sign it using iText.
The flow is - I am creating a PDF, adding the button to it and sends it to my customer. They do whatever they do on the PDF and send it back using the button from within the PDF.
I then want to read the details in my back end and sign it.
Hope this clears things.
Thank you,
Yaniv
Related
I have a tool that allows you to assemble reports generated with fabricjs.
We are trying to convert those reports that currently work on the web to pdf, using the sejda.com tool
The problem with sejda is that it has a generation time limit of 1:50 secs. After that time, the web page returns an error, and we have reports that are taking more than 1:50 seconds to generate completely.
I'm looking for other options, but most don't interpret the content in HTML5, the page comes out blank.
I have tried with html2pdf, javascript2pdf, and a dozen web pages that send the url and try to print the document without success as blank pages.
Is there any solution to our problem? We have been investigating this for months. One of them is to improve the load times of the reports, but it is a complex development due to how it is done.
To solve this I converted the PDF to PNG with PDF.js and stored toDataURL, then retreived the PNG image fromURL and set as background.
or this link can help you : Load PDF into fabricjs canvas
We have finally decided to opt for the caching of the reports.
Now everything works correctly
I have a webform with and want to open it on smartphone - than take pictures of some documents which need to be merged in one PDF, and on the end this file need to be uploaded to server.
My solution is to use Google Drive to upload PDF (scan) to GDrive and then somehow download this file from gdrive to server via some sort of widget (any links appreciate) installed on website.
Maybe someone have a better idea?
I know its late but my answer might help others. I also face the same challenge and implemented a custom solution based on Javascript and Since you are using web form so this solution will perfectly fits on your need.
You have to use JSPdf javascript library, JSPdf provide you pdf object in your browser and you can upload it download it and there are many other thing to play with.
First you have to initialize JSPdf object as per your requirement. I am creating PDF with page size width:500px and height 500px.
pdf = new jsPDF("l", "pt", [500,500]);
Simply when you will take picture from camera you will have each picture in form of base64, that base64 format you have to insert in JSPdf object
pdf.addImage(imgData, 'JPEG', 0, 0);
you can repeat the above code to add pictures from camera as much as you want, at the back-end these images are compiling and creating pdf document where each page have each images in sequence.
Once you are done, you can get PDF object in form of base64 object using below code that you can upload to any server.
pdf.output('datauristring')
above is only pdf part, you can find complete working example including camera part here Javascript Component to Scan Document
I am trying to use print.js(crabbly) https://github.com/crabbly/print.js to send a PDF to a folder on my website instead of printing it.
My task is to save form data into a PDF and save the PDF in a folder on my website once the user submits. I like the way print.js creates the PDF and sends it to print but I need it to send to my folder...maybe through php?
Thanks for anyone's help!!
You need to handle that form submission on the server side. Once you receive the form request or the payload, you can then use it to create your own PDF.
Looks like you may be using Php in the back-end, if that's the case, the FPDF class should have everything you need to create your PDF:
http://www.fpdf.org/
If you use Laravel, here is a convenient package wrapping the FPDF class so we can import it with composer:
https://github.com/crabbly/fpdf-laravel
I want to Showing PDF inside iframe for user preview before download the file or print,
i use byte array convert my report file to pdf then showing it.
everything was perfect until i need something in ssl/https.
because of that i must change my application to ssl/https can some one show me how can i show pdf in this condition.
thanks for listening and reading my prob.
here my code
reportDocument.Load(reportPath);
reportDocument.SetDataSource(dataSet);
_contentBytes = StreamToBytes(reportDocument.ExportToStream(ExportFormatType.PortableDocFormat));
.....
//setting header
.....
//then flush
stream.Flush();
i found the solution in
PDF conversion suddenly fails if reading stylesheet from SSL
the problem is the pdf reader inside my chrome browser.
so i updating my chrome reader in store search pdf viewer..
just it..
I have created a multi page form using the formbuilder module for CMS Made Simple.
The form is submitting all other fields correctly however the upload file inputs are not uploading to the uploads directory.
I have created other forms that work perfectly using the exact same settings so it seems there is a bug in formbuilder itself for multi page forms however I am unable to figure out what it is to be able to fix it.
Does anyone have any suggestions as to why the files are not being uploaded.
Once this is fixed it will also be attached to the email that is sent as the form is submitted but this is an easy fix (just un ticking the box).
Thanks in advance.
The issue is a bug in the formbuilder module itself. A request was made on the CMSMS forge but no replies have been received.
Unfortunately there is no fix so depending on the version of formbuilder you are using you will not be able to upload files if you have a multi page form.