If HTML code contains images with src attribute starting with two slashes (without protocol part), PDF version does not include this image.

Example HTML code:

<img id="chart-chart_field_chart_collection" class="chart" src="//chart.googleapis.com/chart?chd=t%3A2001%2C2002%2C2003%7C14423.00%2C13211.00%2C16732.00&amp;cht=p3&amp;chs=300x150&amp;chf=" alt="Chart">

This image won't be visible in PDF - you will get errors instead:

Image not found
http://my.domain.com/chart.googleapis.com/chart?chd=t%3A2001%2C2002%2C20...

where my.domain.com is my domain name.

I've tried to fix it - the patch that makes it working is attached below.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lklimek’s picture

Patch is attached.

Tested only with "book" content type.

lklimek’s picture

Category: task » bug
jcnventura’s picture

Status: Active » Needs review

I can't understand why you need to call the image replacement explicitly.. The PDF module already does this to all images, and the others shouldn't care... Have you tested with only the modifications you did to _print_rewrite_urls() ?

modstore’s picture

Because the only call the the _print_rewrite_urls() function is with a pattern to match a href's, it is necessary to call with a pattern matching img's as well.

jcnventura’s picture

Status: Needs review » Fixed

Committed to dev, without the duplicate img calls. Please test.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

quoted code formatting