Last post Aug 28, 2017 02:38 AM by markfitzme
Aug 25, 2017 04:07 AM|sweetSteal|LINK
Can someone help me please with ITextSharp.
I created a .pdf file that when the user clicks a button it gets downloaded to their computer.
The problem is that I also want a copy saved on the server.
Its like a shopping cart the user can pick item when they click a button they get a receipt downloaded to their computer but I also want to save that same receipt
on the server. They reason I am doing it this way is that I do not want to search the database and create a second pdf file.
I prefer to search for the pdf file.
I hope that I am trying to do gets understood.
Aug 25, 2017 05:43 AM|asyed4u|LINK
if(print by user)
filename= create the pdf and save to server with "unique_receipt_no.pdf";
else (print by admin/super user)
filename= get created pdf file name from database or (combination of selected receipt)
download the pdf
1) maintain NOTIFICATION table in database for (latest) created pdf file details [pdf name, path
2) load the list (page- admin/super user)
3) print from required pdf from "notification UI" (page- admin/superuser)
Aug 28, 2017 02:38 AM|markfitzme|LINK
The absolute simplest is to have iTextSharp generate the file and save it on the server. You can then use the Response.TransmitFile to send the file to the client.
Timing may be difficult since you need to ensure that iTextSharp has finished writing the file before you transmit it.
Also, since many people don't pay attention and can be blind-sided by this, iTextSharp is not really free. It's free for some circumstances, but if you use it for any application you must submit the entire code of the application that uses it back to the
iText team OR buy a license, which is pretty pricey.