How to add a text to scan (Existing) PDF with Javascript - javascript

I tried to add a text to scan PDF using JS.
I want to develop a program that gets a PDF file and edit it by adding Text to it, using a script.
I need a script in Javascript
I read about PDF-LIB and I couldn't found any of describing.
(I also tried to find a script in python,I couldn't found).
If there another way (api in adobe, languages, etc) to achieve my goal, I'll appreciate to learn about it.
Thanks
Eliran

Related

Modify existing excel file with macro using Javascript

I am now working on an Angular application that modifies an existing excel file (.xls) uploaded by the user then save the modified file in the local. The point is this excel file contains some fancy styling and a lot of macros, with several buttons which contains a lot of VBA code (I am not excel expert, sorry if I mistake their name).
I have tried several existing solutions till now:
xlsx
exceljs
For the first solution, I can only access the community version which basically ignores all these information: style, macro/VBA.
For the second solution, it can preserve almost every style but ignores the macro/VBA.
Except for these solutions, I haven't found any working solution. I turn to the community for help, any kind of solution, even a little hint would be appreciated!

How to generate pdf from html and css in Vuejs?

I'm working on a tool "Resume Builder" using Vuejs. Is there any bettter way to generate pdf ( of resume ) from html with css . I have used jsPdf Library but not getting desired outcomes. I want to keep html "a" tag clickable in generated pdf. I have also tried html2canvas.js but in that "a" tag is not clickable due to image in pdf. jsPdf is generating pdf but not applying css.
I recommend you to investigate a bit different approach for generating PDF from HTML just because all the client-side libraries for HTML to PDF generation have lots of problems when generating really complex documents with lots of formatting etc.
The alternative way is to perform the PDF generation itself on the server-side. For example, you could make use of Headless Chrome managed by your backend for turning any HTML into PDF.
We used a very similar approach to implement pdf generation for this free resume builder service. The only downside we faced was that different browsers like Firefox or IE might occasionally display an HTML document a bit different than it's printed out as PDF bu Chrome. Good luck!
You might want to give Pdf Make a try.
PDF Make on Github
It has support for styling and links. But you have to do most of the styling yourself.
I found Kendo UI is the best api for pdf from DOM.
https://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom

Saving a JavaScript based website to html files, keeping format

I've searched to the best of my capabilities, haven't found an answer.
I'm trying to save pages like this:
http://www.folkbibeln.it/?book=1joh&chapter=1&verse=1
To separate html pages, and keeping the format. I could take each page, copy, paste in a word processing software and save as html, but it would take hours upon hours. I'm thinking there might be some code I could use to automate it? I just can't figure it out, since it's not acting like a straight up html site.
Python is the language I'm using generally.
As an brute-force approach you could use a Headless Browser to load each page for you and save it to a file.
But as mplungjan already mentioned, all texts are in js-files.
You could save these files to your disk, then take the script that builds the html-page and write a little nodejs script that builds all the html-files for you. (Take the original script as a template.)
But nodejs ain't python
Depending on what you're trying to do with the texts, it ain't hard to convert these js-files into JSON and parse it, or directly into a python datastructure that you can import and process in some script of your choice.
Edit:
On a second Look, I just saw this: http://www.folkbibeln.it/chapters/1joh1.html
There seem to be the files you want as plain html, you just have to download them.
All the text is in JS files. You load the URL you gave us. Click ctrl-s and choose Web page complete. Then you will have ALL the text in the folder 1 Joh 1 – Svenska Folkbibeln_files You cannot save as formatted text unless you render the JS in the js files

javascript autocomplete with source being names of files from a directory

I have spent a considerable amount of time googling this and was hoping someone on here had a reference or starting point I could expound upon.
I am looking for a javascript/jquery AutoComplete script which has the source being the file Names inside of a directory. I welcome any suggestions... thanks!
If worse comes to worse, I can just use an AutoComplete script (jqueryui or typahead.js) which has a source file for the results, but then I would have to code a separate function to automatically write to that file each time a new file is put into the directory or is deleted from it, and I am just trying to avoid that should something already exists.
EDIT server side scripting is unfortunately not an option for me. This is being run through an HTML Applications (HTA) file, so fortunately I do have additional freedoms than a typical web application.
I found an article for autocomplete textbox using jsp, jquery has been used but the code is written in such a way the data is retrieved from database and it comes as a suggestion when user types a letter or part of word.
if you are looking for it, you can click it here

pulling pages from a pdf file and display it?

this is just a rough idea, i am trying to create a magazine reading platform and i need the reading flow to be smooth, and so is the magazine upload process, it must be fast and easy. so i am thinking of using pdf file.
I am thinking is it possible to have a module(maybe a system?) to pull each page from the pdf and display it in a interface written in html? i know there is something similar in flash, but what i want it is something lighter and easier from development. coz at the end i am gonna put this module into maybe a cms system.
thanks in advance guys:)
Regards,
WJ
hi guys i just found this solution, pdf.js, it uses javacript to implement pdf displaying on the web page, it also able to create pdf file from javascript.
anyway the reader is there, and interface is able to change since it is html, i guess this should be the solution.

Categories