images with 100% width in PDF export

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2014

Hi,

I just witnessed a strange behaviour.

I have a big image in my wiki page and for the PDF export I want it to fill 100% of the text area (text area = that width that can be filled with text, not the same as full width of the page).

But whatever I try, the image is too small and ends at about 4cm before the right margin of the PDF.

I included ridiculously big images with 3000px width, changed the image width in the source code, set the image width in the PDF to 100% (as described at Expanding embedded images on PDF exports?) and then erased everything I had in my PDF stylesheet but nothing changes.

Is there some kind of limit that can not be extended because that is how it seems?

 

4 answers

1 accepted

4 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2014

This is a known issue. See https://jira.atlassian.com/browse/CONF-33727

The workaround in the global PDF Stylesheet worked for me (See comments):

.confluence-embedded-image
{ -fs-fit-images-to-width: 100% !important; }
1 vote
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2014

There is a price for everything in life !

I just found out that now that I have included the code from above I have created a new problem:
==> (Some) images within table cells disappear when the page is exported to PDF.

It is all a bit complicated:

  1. When I leave my PDF stylesheet untouched and just comment out that code the images reappear
  2. But I have also had test runs where I changed 500 other things, left that code in and images would also show
  3. For a while I was also puzzled because independent from the above some images showed and others didn't. Then I found out: Images that do not show are only those whose size was NOT changed. Big images that were minimised to e.g. 300px always show.

In the end it seems to come down to some new fancy workarounds:

  • I leave everything as it is for pages with full size images or with resized images in tables
  • I comment out the 100% code for pages with unresized images in tables
  • If none of the above works I do a "fake resize", that is, I click the image and change its size, then I open firebug, go to the page's source code, search for the image's width and change it back to its original value.

 

PS: I am aware of that bug report at https://jira.atlassian.com/browse/CONF-31874 What it describes is similiar but not exactly the same.

0 votes
salvatore August 25, 2015

Did you mean to resize image after PDF processing? Do I need another 3rd party toolits to help with it? Any suggestion will be appreciated. Thanks in advance.

 

 

 

Best regards,

Salvatore

-------------------------------------

Tags: resize image

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2015

No, I was talking about something else.

0 votes
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 12, 2014

Thanks a lot, Jobin. Perfect answer for me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events