javascript / html / other programming language in PDF file - javascript

Is it possible to embed code inside a PDF document ?
I'm interested in creating a PDF document with a dynamic image,
so once a user will open the PDF in a certain time he will get to see image 1 and on a different time he will get to see image 2
(both images source will be on the web and will require HTTP transfer).

Looks like it is possible but it does not seem trivial:
PDF with dynamic image

Related

Open Seadragon: Download currently displayed image in Viewer

I'm using Open Seadragon and loaded multiple images into the viewer with
tileSources: ['http://url.com',
'http://url.com',
'http://url.com',],
The files that I linked in tileSources are all json but I want to download a jpg image.
How can create a function that downloads the currently viewed image?
Do you want the exact view that's in the viewer at this moment? If so, you can copy the contents of the HTML canvas at viewer.drawer.canvas.
You might also check out https://github.com/KTGLeiden/Openseadragon-screenshot.
If you want the full high-resolution version of the image (not just what's in the viewer at the moment), I'm not aware of anything that does that.

html2pdf cuts content in half when html is converted to PDF - javascript

I am trying to achieve webpage to PDF conversion using html2pdf library in javascript but content is cut in half when documents are longer than 1 page and elements like e.g. images happen to be between pages. How can I get them to the other page if they don't fully fit within the previous PDF page?

How do i convert all the data in my webpage to a pdf and download it on the browser?

My task requires me to click a button on the webpage and download the data as a pdf file. Simply printing the webpage wont do as there are certain tabs which are visible only upon selection.The data source is readily available on the pagenameVM.js. I tried using jsPDF but that works only for a certain div in the page.I need to write the all the required data into the pdf and then download it.
Is it possible?

Getting Coordinates of Embedded PDF

I would like to embed a PDF in a webpage. When a user clicks on a certain coordinate within the embedded PDF, I would like to know what coordinate it corresponds to with respect to the PDF (and not the browser window). I will then plan on inserting text into the PDF server side so that a user can click on a portion of a PDF and add text to it through the webpage.
Does anybody know of any JS or other solutions to do this? I am using Django for the website.

HTML5 Canvas Example Screenshots

I have come across html2canvas thanks to a previous question of mine. What I am confused about is how could I implement it to do the following:
Create a live thumbnail of a live website.
When the live thumbnail is clicked it loads a bigger image of the website.
What would be the best way to feed the uri's into the script?
All images will have specific hxw set in the image tag or the css for the specific class.
If the website you are trying to create a thumbnail for is different from the actual page the user is on, you'll need to first download the HTML of the page to your server (same origin), after which you can wrap it inside an iframe and create a screenshot of that.
The screenshot generated will be 1:1 size with the actual site, so to create a thumbnail you'd have to resize the screenshot.
The script doesn't accept HTML, url's or anything else except for DOM elements as an input for rendering a page. As such, the only way you can generate a screenshot using the script is to have it either load on the page where you want the screenshot to be generated or load the page within an iframe (under same origin, so you'll need to download the source through a proxy if you use cross-origin).

Categories