Import HTML is an attempt at implementing a website import function for InDesign
LATEST UPDATE: May 2018
Note: This script can currently only import online, publicly-accessible websites!
If you need to import HTML files saved locally on your personal computer, or if you need to access websites that require a username and password, we may be able to help. Get in touch!
Here’s an example of importing a page from a racing blog:
Instructions
Download the script, and install as usual for InDesign scripts.
Open the supplied HTMLTemplate.indd file and double-click on the script in the Scripts panel to run.
Paste the URL of the web article you want to import into InDesign and wait a few moments for the result. (A default link to an article is provided in the URL field, so you can try that first…)
What you get
You do not get an InDesign document that looks like the webpage!
What you hopefully do get, though, is:
(a) The text from the webpage, with sensible character styles and paragraph styles applied to it. All paragraph-level HTML tags (H1, H2, H3, p, etc.) are converted to similarly-named paragraph styles, and span-level HTML tags (em, strong, i, etc.) are converted to similarly-named character styles.
(b) The images on the webpage (optional).
(c) If there are tables on the webpage, these are reconstructed in InDesign. Very simply, though. So if the entire page is one big table, don’t expect too much!
(d) Hyperlinks. If there are any anchors (<a> elements) in the HTML, these are converted to hyperlinks in InDesign.
Included in the download package is an InDesign file that can serve as a template for importing HTML. It includes pre-styled paragraph and character styles for common HTML tags. Note that the supplied template file is very basic and its use is completely optional. It just provides basic formatting for a handful of common elements.
What is it for?
Probably, the main use of importing the HTML into InDesign with this script rather than just copy-pasting from your browser is that the text comes in with paragraph and character styles applied – so it is ready to copy–paste into the document you’re preparing with very little hassle.
You also get the images imported.
So, have fun, and please leave feedback. I’d like to know what you use the script for, and how it goes!
Download
How it works, and a note about privacy
When you paste a URL into the script window and click OK, this URL is transmitted to our server (hosted by Bluehost.com) over an unencrypted connection. The server then fetches the requested web page, does some pre-processing on it to make it ready for InDesign import, and then sends it back to the HTML Import script, which places the file, downloads the pictures, and completes the formatting in InDesign.
The URL provided is logged by the Id-Extras.com server. No other information is stored, so while we do have a list of URLs requested, we do not store anything about who requested them.
Gema
September 22, 2024 6:57 pmMe funciona el script en 2020 y en 2024, pero en la version 2022 no, es posible?
Ariel
September 24, 2024 1:50 amIt’s not impossible 🙂
Javier
October 24, 2023 9:21 amHello,
In the InDesign 2024 version it doesn’t work. In the result there are many codes that do not appear in Indesign 2023 (with the same url, of course).
Thank you very much for the work. The extension is very good.
Ariel
October 24, 2023 9:07 pmHi Javier,
Can you share the URL you were using, so that I can do some testing?
Ariel
Javier
December 27, 2023 12:16 pmSorry, I thought I had already answered you.
What happens is that a fairly long javascript statement appears, but once deleted, all the text appears.
The url is this:
https://www.frontiersin.org/articles/10.3389/fvets.2023.1302528/full
Thank you so much,
Ariel
December 31, 2023 2:43 amHi Javier,
I will try and find time to look into this, but I don’t know when that will be…
Donna
October 17, 2022 11:13 pmHi was wondering, your comments not you are capable of building a script that pulls in html files
“If you need to import HTML files saved locally on your personal computer, or if you need to access websites that require a username and password, we may be able to help. Get in touch!”
Do you already have that type of script available for a fee?
Thanks
Ariel
October 18, 2022 12:37 amHi Donna,
Yes, a version that imports local HTML files is now available for a fee.
Get in touch via email and I’ll send the details.
Claude Keyrouz
February 4, 2023 3:11 ami need this script as well. what is your email?
Ariel
February 7, 2023 1:53 pmHi Claude,
Contact details are on the Contact page (https://www.id-extras.com/contact/)
Thanks,
Ariel
Florian Wyzniak
April 25, 2020 7:36 pmHello Ariel,
thanks for your work already. In wonder if there is a way to just use your script to only put an URL of an image into a textfield. I tried your script and managed to put put whole blogs with several images and texts into my document but if I use an url with just an image nothing appers. What am I doing wrong?
Thanks already for answering.
Best regards,
Florian
Ariel
April 30, 2020 4:47 pmHi Florian,
Try wrapping the image in a div tag or p tags, or otherwise making it valid HTML.
Ariel
Nate
December 9, 2019 6:55 pmJust wanted to say thank you for this script – I am pulling a family blog into InDesign, and your script will save me hours and hours of manually importing photos.
Nathan
February 1, 2019 6:53 pmHi Justin, I’m trying to do the same thing. Did you figure it out?
Justin
January 15, 2019 6:29 amForgive me I am new to indesign and mail merge.
I was wondering whether you think this script might be useful for mail merging images that you don’t want to have to download locally each time? You could just enter the URL into an excel field and indesign would automatically download the image in the right place.. does that sound like it could work?
Thanks!
Ariel
January 15, 2019 1:20 pmHi Justin,
This script could certainly be expanded to include such functionality.
(There might already a free script floating around that will pull images into InDesign based on a text URL. Worth googling for that.)
Ariel