Convert html to pdf with pdf.js [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am a complete rookie in js libraries. I want to create an offline application in chrome, which will as a result convert an html file into pdf.
I discovered that it could be done by Mozilla's pdf.js? How can I start it? I am trying to understand the tutorial, but I am missing smth.
I have html page and a javascript file. Where and what shuold I import, and how to export this html file (forms, text and images) into pdf.
Thanx

You can't use pdf.js for this. It can only render (some) files. It does not produce PDF, nor does it handle HTML input.

Related

How can I create a web app to edit a large JSON manually? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
I have a large JSON file, about 100 MB in a folder. I'd like to manually inspect some attributes, and then add more attributes to some of the objects and finally save changes and get output a modified json file.
Can someone suggest me how to do that?
I wanted to try with vue.js framework but I'm not very expert. If you know a video tutorial about this, please let me know.
Is using vanilla JavaScript the right choice or not?

How to use links to download PDF files in Vue/Nuxt [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
this is a bit silly but I am having problems to open one PDF tab in my Vue application with NUXT and Vuetify..
I am trying to use
Download PDF
I also tried to use <nuxt-link> but didn't work.
The file is placed inside ~/static/docs folder.
The answer I receive is "This page could not be found"
Thank you.
I remember having the same trouble as you a few months back.
While looking at some older code it turns out I used a module called vue-pdf.
After declaring the module as a component like so:
components : {
pdf : PDFViewer,
}
You can just use it in your markup by passing in your link:
<pdf :pdf="brochureDocument"/>

How to extract text from a pdf file in javascript? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
So I am wondering if there's a way to extract text from pdf in javascript? I have already surveyed some npm modules like PDF-TO-TEXT but they all take in a file path name as input. I am using the react-drop-to-upload module to allow the user to drop the pdf to a react component. The react component takes in the pdf file and returns a File object rather than a file path. Is there a way to convert PDF stored in an File object to text? Thanks!
PDF.js allows you to load file objects and then parse the document as a text. This example from the official website does exactly that.

convert to PDF from html or svg, which one is best? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am going to work on some project where i need to create PDF of some sections in webpage...
Its completely in decision phase what should do for it...
So i have found that we can convert HTML to PDF using some js OR other lib which work at server end...same i found for SVG images...
But confusion is like some time info found as HTML to PDF is good idea whereas few says SVG to PDF will be good for you to maintain Quality etc...
So I wan views with experience that which is best way to go with?
If you need to create a PDF of a webpage then you'll have to convert from HTML to PDF. You cannot convert from SVG to PDF because simply you don't have the SVG - which is a vectorial image format - to start with. Then the question is not whichever it's the best, it's which is the most appropriate for your use case.
Note that HTML describes the structure of a document, not its style (this can be done via CSS) and hence not the way it appears.

How does soundcloud generate their html? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Today I was inspecting the soundcloud source-html through chrome, but it only returned a basic(very small) html dom.
So I was wondering how do they generate their html?
I'm curious because soundcloud is a pretty big website and I doubt they generate all the html though javascript, but when I checked their javascript I could not find any <div tags or anything like that.
For larger dynamic websites usually a template framework is used like EJS - http://www.embeddedjs.com/
With templating you can embed JavaScript logic directly into the HTML so it changes and updates dynamically.

Categories

Resources