Maven 2.x PDF Plugin

Relative images are not recognised in sub folders

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.0
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 2.1.0, Windows XP Pro, Java 1.6
  • Number of attachments :
    4

Description

If parts of the documentation located in sub folders under the "apt" folder images are not recognised

Example:

(file under "apt/administration/overview.apt")
// SNIPPED START >>

Following the overview

[./../images/overview.png]

// << SNIPPED END

The created html pages are correct. If I create the pdf I got

ERROR [org.apache.fop.fo.FONode:83] 2009-04-03 11:35:05,250 - Image not found: ./../images/overview.png

I enclosed an sample project that shows the issue.

Issue Links

Activity

Hide
Lukas Theussl added a comment -

The second version (with "../") does work for me, can you attach the -X output, maybe you are not using the latest snapshot?

I'll have a look to fix the first issue.

Show
Lukas Theussl added a comment - The second version (with "../") does work for me, can you attach the -X output, maybe you are not using the latest snapshot? I'll have a look to fix the first issue.
Hide
Marco Huber added a comment -

I attached the output. As far I can see I use version "1.0-20090309.102020-2".
Its the latest in the snapshot repo of apache.

Show
Marco Huber added a comment - I attached the output. As far I can see I use version "1.0-20090309.102020-2". Its the latest in the snapshot repo of apache.
Hide
Lukas Theussl added a comment -

That's the correct version. FYI, I just deployed a new snapshot that uses the latest doxia snapshots which fixes some minor issues.

However, I do not understand why you get the same warning twice (Image not found: ./../images/overview.png), but nothing about ../images/overview.png. Did you check whether an image is actually included in the pdf? I only get one warning and the second image is in the pdf.

Show
Lukas Theussl added a comment - That's the correct version. FYI, I just deployed a new snapshot that uses the latest doxia snapshots which fixes some minor issues. However, I do not understand why you get the same warning twice (Image not found: ./../images/overview.png), but nothing about ../images/overview.png. Did you check whether an image is actually included in the pdf? I only get one warning and the second image is in the pdf.
Hide
Marco Huber added a comment -

Maven downloaded the new snapshot (including doxia) but I get allready the same warnings. The created PDF contains no image.

I attached the log from the running and the created .fo file. There are only

<fo:external-graphic src="./../images/overview.png" ...>

references. Both the leading "./".

Show
Marco Huber added a comment - Maven downloaded the new snapshot (including doxia) but I get allready the same warnings. The created PDF contains no image. I attached the log from the running and the created .fo file. There are only <fo:external-graphic src="./../images/overview.png" ...> references. Both the leading "./".
Hide
Marco Huber added a comment -

Found out something more about why [../images/overview.png] is not going.
I debugged and see in the FoAggregateSink (from doxia-module-fo) that the docName attribute is "./overview\overview".
The call of the resolveLinkRelativeToBase returns the wrong value.
The code line

String base = docName.substring( 0, docName.lastIndexOf( "/" ) );

return ".".

Because of the backslash in the docName the string is cutted after the ".".

Show
Marco Huber added a comment - Found out something more about why [../images/overview.png] is not going. I debugged and see in the FoAggregateSink (from doxia-module-fo) that the docName attribute is "./overview\overview". The call of the resolveLinkRelativeToBase returns the wrong value. The code line String base = docName.substring( 0, docName.lastIndexOf( "/" ) ); return ".". Because of the backslash in the docName the string is cutted after the ".".
Hide
Lukas Theussl added a comment -

I just reproduced your problem on windows, so at least the issue is clear now. We will have to re-write the relative path resolution in a more generic way.

Show
Lukas Theussl added a comment - I just reproduced your problem on windows, so at least the issue is clear now. We will have to re-write the relative path resolution in a more generic way.
Hide
Lukas Theussl added a comment -

Fixed with DOXIA-306.

Show
Lukas Theussl added a comment - Fixed with DOXIA-306.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: