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.
David Blatner
April 26, 2017 8:03 pmCool, Ariel! This is really going to be helpful. I’m looking forward to new, more robust versions!
Ariel
April 26, 2017 8:22 pmThanks David!
Uwe Laubender
April 26, 2017 8:13 pmHi Ariel,
just tested your script. Cool. Especially the image import…
What bugs me a bit is that I cannot paste in text—my URL—to the edit text field of the script’s alert at the start. I have to type in the URL. That could be a “speciality” of InDesign on Mac OSX …
Thanks,
Uwe
Ariel
April 26, 2017 8:22 pmThanks Uwe. On MacOS you right-click and choose “paste”…
Uwe Laubender
April 26, 2017 8:57 pmOops…
Yes. Right-click > Paste is working.
Thanks,
Uwe
Ariel
April 26, 2017 9:14 pmYou’re the second person to ask me that today!
Keith Gilbert
April 27, 2017 5:21 amWell done Ariel! Wow.
Uwe Laubender
May 5, 2017 3:37 pmThank you very much for providing the source with version 06.
Uwe
Annukka
May 9, 2017 11:47 amThank you veru much, really useful!
Tobias Trofast
November 3, 2017 12:05 pmGreat work,
I really like the idea and been looking for something likes this for a while. A few humble suggestions and ideas:
– Language support. Seemlingy unknown characters are simply cut out. The page I tried to import had a UTF-8 encoding, uncertain if the script detects that?
– Paste code instead of url as an option.
Ariel
May 13, 2018 5:39 pmHi Tobias: I’ve tested it, and I believe it now works pretty reliably with UTF-8.
Pasting HTML is coming soon, if there is enough demand.
adina
December 20, 2017 9:54 pmhello, i was wondering if you could help me with actually importing a 930 post blog :), its on wordpress.com, and since every few dozen posts the address changes and lists a different page i was wondering if there was a way to import all posts without doing it manually for the 135 different pages 🙂
thanks,
adina
Ariel
January 7, 2019 12:06 pmThis could definitely be done, but would require some custom scripting. Get in touch for a quote.
Andre Wyss
May 18, 2018 12:35 pmHi Ariel
Unfortunately in my case the script doesn’t seem to work. OSX 10.12.6 | ID CC 13.1. I’ve tried several websites (e.g.https://magazin.swisscom.ch/datensicherheit-infrastruktur/treuhaender-datenschutz-outsourcing-praxis/). When I start the script, a small window pops up (with fast changing text) and dissappears, but the empty document doesn’t change at all. Any tipps or hints for this?
Ariel
May 18, 2018 12:53 pmHi Andre,
Checked it and it works for me (though it doesn’t succeed in importing the 2 big images on the page). But the text comes in nicely formatted, that is with appropriate paragraph and character styles applied.
If you’re seeing “fast changing text”, my hunch is that you’ve got some sort of a firewall that is blocking InDesign’s connection to the outside world.
In which folder have you installed the script? Sometime the “Application” folder has more permissions that the “User” folder.
For corporate clients who have firewall issues like yours, the answer is to install the whole mechanism on their own protected servers. You, or anyone for whom this would be applicable, should get in touch about that.
Andre Wyss
May 20, 2018 1:50 pmHi Ariel
I’ve tried your script outside our corporate environment and now everything works fine. Thank you for the helping hand the usefull script.
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
Nathan
February 1, 2019 6:53 pmHi Justin, I’m trying to do the same thing. Did you figure it out?
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.
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
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
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