Html form to PDF (client side, predesigned PDF form) - html

is there a way that when my users filled in everything in an html form, then there is a download PDF button and these datas will pass to a PDF and save as a pdf to the desktop, however the client does not allow me to use any of the Server side script.

You could have used FPDF Library, but it is server side solution. Probably it is impossible to do without any server side script.
Edit:
Although, I have just find some JS solution. Read this:
Generating PDF files with Javascript

Yeah there is, but you'd have to use a 3rd party solution like pdfmyform.
You just put a link on your webpage and the link transmits all your page & form info to the webservice and returns a PDF. You'd only have to think if you're ok with sending all the content over to a 3rd party.

Related

How to retrieve the HTML code of a particular site's homepage

I want to get the HTML code of a particular site. It asks me to register myself first so that I can be redirected to their home page. Now, my question is: is it possible to retrieve the HTML code of the desired page just by choosing option ‘View Page Source’ which appears on right click? Is there any other way to fetch the HTML code?
There are multiple ways of getting the HTML source code of a page
One way, as you already know is by viewing the page's source code.
If you Right Click -> View Page Source or just press Ctrl + U you will view the source code in your browser
If you are using linux, you can use wget to get the source code.
Just open up a console and type wget www.somewebsite.com and you will get the HTML source code along with any CSS and JS links.
However, you cannot get the PHP code using any method unless you have FTP access to the server
Yes it is possible to view HTML via 'View page source' or you could use PHP as mentioned in the comments.
'usign php yes php.net/manual/en/function.file-get-contents.php –
Vitorino fernandes'
You could also let a website and or program do it for you but it's trustability depends on the site and or program,
Do note it is NOT possible to view the PHP source since that is server-side.
Using any browser, the "View Page Source" option will show you the source of the page, as received by the browser (which may be different then the source currently displayed). You also have the option of using the File > Save Page As (or similar) menu option to save a copy of the html code of the page from the browser.
It is also possible to use command line tools like curl and wget to download the page to your local machine. Those tools provide options to send data (such as cookies or headers to identify yourself) along with the request.

How to prevent viewing website code

I have a website that has a lot of data and that is sensitive to the website so I made a code that prevents right clicks but if you are using Safari it is easy to see the data I need to hide the info also so safari cant view it ether.
Client side, you cannot secure your code from view. Firebug will still show the code. You should have sensitive data on the Server.
You can't.
If the data is sufficiently sensitive that people shouldn't be able to view it, don't put it on a web site.
I m not sure if there is a completely safe solution.
if its images, use flash to load them dynamically.
yet people who knows swf-bin specs can decompile your swf files and find out the real image path.
if its data & text.
as much I can do is to
1: use pure js to render all views.
use XMLHttpRequest/ActiveXObject to load data and import these ajax js code # runtime.
compress your js/css code before deploy
here is one of my mockups
2: on the server side
check the request header to drop command line request.
exchange cookie/session key for each time.
BUT, this will make google-bots don't know how to inspect your site.
so DON'T do that on your landing page.

webapp save webpage with form contents to pdf in iPad

I have a form with some boxes to use handwriting and signature in an ipad, it is
http://asbec.mx/form
I want a button to save as pdf and another one to print via airprint.
It is for a webapp.
I have already tried a button to save as pdf as you can see, the problem is that it creates a blank form.
Thanks for your support
This seems to be something that should be handled on the server end. You might try something like Zend PDF framework (extended PHP library).
http://framework.zend.com/manual/1.12/en/zend.pdf.html

Sending a html form via email as a pdf

I have made an html form. What i want to happen is when the user clicks submit for the page to be emailed as a pdf (like the pdf that comes up if you print the webpage). I've been looking a all sorts of script but nothing seems to do what I want.
You will have to have a server-side component that takes the values, creates the PDF, and then e-mails it appropriately.
You'll be surprised to hear that not all browsers can easily make pdfs out of web pages. Hence, there is no universal JavaScript command that simply taps into a browser's capabilities. That leaves you with options:
Generate the pdf on the server (using, say, pdfbox, and send the email right from the server (using good old sendmail).
Generate the pdf on the server, have the user download it, and then transfer it all to his email client. (Might just work, see on Stackoverflow).
Generate the PDF in the browser, cross-platform. There are some Javascript-only libraries that can generate PDF.
Use Safari's PDF capabilities. Safari can make PDFs just in the print dialog. Explain that to your users and call window.print().

PdfSharp, GDI+ and HTML printing

I currently have a "PrintingWebService" that I call from an AJAX page with all the information that is needed to construct a highly customized PDF printout using PDF Sharp and the PDFSharp's GDI+ mode, which takes DrawString and other commands that work basically just like GDI+ only they are drawn to the PDF.
I then save the PDF file to a location on the webserver and return the file name from the web service, and the AJAX page opens a new window with the pdf file.
So far, it works well, however, there is one part of my AJAX page that I want to printout and I haven't come up with a solution for yet. I've got a string of the HTML content of a TinyMCE editor that I want to dispay in the bottom part of the PDF page.
I'm looking for some sort of tool I could use for this purpose. Even something opensource that prints to GDI+ I could use by taking the source code and translating it to use PdfSharp's GDI+ (the class names are like XGraphics, with each class having X before the GDI+ name).
If I have to I will limit what HTML can be generated by TinyMCE and write my own renderer, but that will be a big challenge, so I'm looking for other solutions first.
I've stayed away from a printer-friendly page approach because I wanted to construct a page that was a near identical of an existing WinForms printout, using my existing code. With PdfSharp I was able to convert all the code except the text area stuff (which used the RichTextBox and RTF in the WinForms version).
Tony,
I personally have used WebSupergoo's ABCPdf library with much success. You can actually render HTML directly to the PDF and it does fairly well in regards to accuracy.
Another free software that will allow you the flexibility of writing HTML to PDF that I have used in the past with much success is iTextSharp.
Otherwise, I think you'll have to write something to render HTML to GDI.
Either way, you may want to consider using an HttpHandler that you map to using your web.config to generate the PDF file. This will allow for you to render the PDF to a bytestream and then dump it directly to the user (as opposed to having to save each PDF receipt to the web server). It will also allow for you to use the .pdf extension in the page that returns the receipt (PurchaseReceipt.pdf could be mapped to a HttpHandler)... making it more cross-browser friendly. Older versions of Adobe / Browsers will not display correctly if you start throwing a PDF byte stream from an ASPX page.
Hope this helps.