By default embedded (using an IFRAME) Youtube videos will be displayed as a black rectangle in the resulting PDF. To display the Youtube preview image you can use s simple JavaScript workaround (see script.txt). This script extracts the video ID from the URL and uses it to retrieve the preview image of the video. This image will be used as background image and the original URL will be removed. Finally the IFRAME will be enclosed by a link which points to the original video on Youtube.

The script can be used as follows in your PDFreactor integration (Java API in this case):

// Activate links
config.getUserScripts().add(new ScriptResource("", "URL/to/script.txt", true));

The beforeDocumentsScripts parameter should be set to true, as this decreases the conversion time.

Please note: Tghis script will only work with Youtube videos which are embedded using an IFRAME.