AngularJS (HTML, CSS) to pdf in client side - javascript

i'm making web for a internet cafe with angularJS.
When user has been registered, they will see their member card in HTML format with button print.
If the button clicks, it will download automatically the member card as a pdf file.
any ide ?
it wil be helpful if you make an example code :)
thank you.

You can use phantomjs PDF rendering. rasterize.js rasterizes a web page to image or PDF.

Related

PDF.JS - How to store PDF on server

I am new to pdf.js. I am able to view PDFs using the example viewer and all is good. I'm able to view an interactive Acroform and fill out the fields too. When I view the Acroform, the "download" button mysteriously disappears. I type some data into a text field on my PDF form. Now, I would like to upload the PDF (with the data in the text field) to a server side servlet. To simulate, I tried to download but, remember? The button is missing! So, I open the dev tools in chrome and unhide the download button and click it. Viola! It downloads the PDF to my local drive (with the data in the text field).
Now, instead of going to my local drive, I was to POST this to a servlet and save it server-side.
Any clues or hints would be greatly appreciated . . .

Uploading an HTML page to Sharepoint Library using Chrome Extension

I receive maintenance reports for certain devices by being emailed a link. I click the link and get an html page in my browser. This appears to be a REST request to me.
What I want to do is create a Chrome browser action that when clicked will upload that html file to a Sharepoint Document library. I'm not sure where to get started with this. I was attempting to create an XMLHttprequest to get the file and then I was going to look at using the sharepoint rest API to upload it, but I am getting no where. I am hoping to get some recommendations on which way to go.

Export my SharePoint aspx page to a PDF file

I am working on an enterprise wiki site collection , and using the SharePoint designer I have manually added a link named “Print to PDF” as follow:-
But I am trying to implement the link functionalities, so when the user clink on the link, the page content (mainly any html components that are inside the rich text ) should be displayed inside a pdf file?
Can anyone advice how I can achieve this ,, can I write a javaScript code which can do the work ? Thanks
You can develop an ASPX page (actually preferably an ASHX handler) that does the work for you by accepting an URL to convert, which you then pass into a third party HTML to PDF library. The generated PDF file can then be returned to the user's browser.
Alternatively, have a look at this blog post (that I wrote, so big fat disclaimer about me being biased) that shows how you can buy a product off the shelf that does all the work for you.
You can read more about it here.
BTW, for questions related to SharePoint you may want to consider using sharepoint.stackexchange.com.

Save HTML5 page as PDF

On click of a button, without doing a round trip to the server, can we save a HTML5 page on clients machine as PDF.
Check out PDF.js. This lib can create pdf in the browser (or serverside on node.js).
Using chrome you can print the page to a pdf file.
You need something like this, maybe server-side you can start a browser and print the content to a pdf file and send this to the client.
Disclaimer: i work for ByteScout
If you have simple HTML formatting and want to generate PDF on client side and if you have non-commercial project, check BytescoutPDF.js - it supports simple HTML formatting for text (font name, size, color) plus simple drawings and images, should be enough for simple reports

How to create a jpg image with Javascript?

i'm creating a web application to generate images according to user's input, more precisely a barcode generator. i'm using javascript to process the data input by user. In the end, i want to have my output barcode as an jpg or png. What other tools do i need? I know that javascript cannot create the .jpg or .png file for me. What other tools can help me generate an image file?
Its possible using Canvas element in HTML5
http://blog.nihilogic.dk/2008/04/saving-canvas-data-to-image-file.html
I dont know i there any free script is out there but you can try this one:
http://www.java4less.com/barcodesjavascript/barcodesjavascript.php?info=intro
Hope its help,
Karls
I have created previews of user driveways after pavement using PHP GD with a picture submitted by the user.
It's done with PHP so you would POST the data to a PHP script on the server side and create the image from there.
I went as far as having the user click and make a path of the section to remove (the old driveway) and use that to cut out the driveway and replace it with a background layer.
You can set up PHP locally with Apache or IIS. PHP is pretty much standard on all hosting services.
You could build an image editor with it.
https://www.php.net/manual/en/book.image.php

Categories