-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admonition graphics does not render to pdf with custom STYLEROOT #719
Comments
With no custom xslt and this command line: Got the expected result but I want to make more style changes and running all from string param will difficult collaborative work. Thanks in advance |
@tomschr Any ideas? |
From what I have been able to see when the custom style sheet is not used, the two links are created within |
Hi! If I create the link to images within .tmp manually, the watermark and the admonition graphic are rendered correctly in the pdf document |
Hi @kalimalrazif, From what I've seen your graphics are not found. You need to distinguish between two different types of graphics:
Relative paths can be tricky. 😉 You could use these strategies to investigate this issue further:
Could you attach your custom XSLT stylesheet? By the way, you've used DAPS 3. Although it still works, the more recent version is DAPS 4. Although it is in beta state, we use it daily and it works. Additionally, many bug fixes were added to version 4 plus it supports topic oriented writing with assemblies. Perhaps you should consider switching to DAPS 4. |
Hi @tomschr :-) Sure, this is my stylesheet:
In my case it would be the second situation. The watermark of the draft, and the graphics of the admonitions. When I started, I created the stylesheet and only enabled the admonition graphics. When I wanted to render the pdf the file not found messages started. Investigating the error messages I saw that I needed a Doing a little more research I deactivated my style sheet and activated the graphics via stringparam and voila the graphics appeared. I then took on the task of seeing what was happening. And I realized that with the stringparams, make created a If I, using my style sheet, manually link the standard images directory into the Oh excellent, I'm going to change to version 4 then and try to see if the situation is resolved :-) Thank you very much in advance |
Hi! I tried with version 4 and the behavior is maintained, if I manually link the standard images directory (admonitions, callouts, drafts, etc.) inside the Which tells me that either the makefile has to link the standard images directory of the distro to the directory inside the Again, thanks in advance :-) |
Ok, thank you @kalimalrazif! It seems, DAPS doesn't copy the respective images. 🤔 I've tried to reproduce it and did the following steps. Maybe that helps you too:
This should add an admonition note graphic in the PDF: This is the directory structure after the build:
Maybe there is an easier way to do that. It looks like that daps tries to create a link to the
However, it's not there:
@fsundermeyer Is this a bug or how is it supposed to work? Perhaps this could be considered as an extension: if someone want to use a customization layer and the directory Detailed log file of daps build (click me)
|
Hi @tomschr! What puzzles me is that when you just use the command line parameter But if you use your own style sheet it only links to At the end of the day the directory used to render the images is There's even a comment in the
Thanks in advance |
Previous implementation was simply wrong (and even caused make errors in some cases) Fixes #719
Hi @kalimalrazif , If you want to test: |
Thanks @fsundermeyer !!! :-) I will test it as soon as I can :-) |
Hi! I tried and the admonitions worked perfect :-) the thing now is the draft watermark :-( but I thing the same solution can apply to the watermarks. This is the log output:
Thanks in advance |
Hi! Looking at your solution I figure out a workaround by setting this on my DC file: |
Just a side note. Reading your log output, I found this warning:
Do you use some entity file that you include in your other XML files? Does your entity definition contain DocBook tags? If that is true, you are missing the DocBook 5 namespace. You should always add the <!ENTITY emqu "<emphasis xmlns='http://docbook.org/ns/docbook'>EmQu Advanced Services</emphasis>"> |
Hi,
actually it is my believe that at least for FO the best is to put this into the styleheets - I think this is where it belongs. And if I am not mistaken, this should work out of the box without the need to provide parameters for DAPS (for FO!). @tomschr correct me if I am wrong. Unfortunately the story is different with HTML, since DAPS has to copy the images from the stylesheet directory into the resulting HTML directory structure to enable distributing and publishing the HTML. I could add the same "guessing logic" I use for HTML (for callouts and draft) in PDF as well. Downside is that this is hardcoded and will overwrite settings provided via parameter (those arew silently ignored for HTML ATM). What do you think? |
I hope I got it right, but I fear this is not how XSLT works. The problem is that XSLT 1.0 does not know how to convert a relative path into an absolute path. Although you can add an absolute path, such path won't help as it would only work for a specific user. Path manipulation was added in XSLT 2.0/3.0 which we don't use (yet). You also cannot add something like $PWD in a stylesheet. That is shell, not XSLT. XSLT has no means to know the environment. To circumvent that issue, you have to set the parameters outside of the stylesheets and pass it through daps or the XSLT processor. This is what Normar did and it worked that way. This can't be solved through XSLT 1.0 alone (so it wouldn't make sense to take it upstream). I can imagine one way how it might work: DAPS could pass something like I'm not sure if this is worth the effort. Adding the corresponding lines into the DC file is probably the more efficient solution. |
Previous implementation was simply wrong (and even caused make errors in some cases) Fixes #719
Simplified and fixed handling of admonition and callout graphics in PDFs. The following locations for these graphics is supported: STYLEIMG= 1. <STYLEROOT>/fo/static/images 2. <STYLEROOT>/fo/images 3. <STYLEROOT>/static/images (suse-xsl-stylesheets) 4. <STYLEROOT>/images (DocBook upstream) First one (in the order above) wins if multiple of these locations exist. It is assumed that the image directory layout follows DocBook upstream where the admonition images reside directly under $STYLEIMG and the callouts under $STYLEIMG/callouts/. Note that in DocBook upstream admonitions are disabled by default and that low resolution PNGs are used when acticvated. Consider using the following parameters on the DAPS command line or use PARAM/STRINGPARAM in the DC-file to override: -param="admon.graphics=1" --stringparam="admon.graphics.extension=.svg"
Simplified and fixed handling of admonition and callout graphics in PDFs. The following locations for these graphics is supported: STYLEIMG= 1. <STYLEROOT>/fo/static/images 2. <STYLEROOT>/fo/images 3. <STYLEROOT>/static/images (suse-xsl-stylesheets) 4. <STYLEROOT>/images (DocBook upstream) First one (in the order above) wins if multiple of these locations exist. It is assumed that the image directory layout follows DocBook upstream where the admonition images reside directly under $STYLEIMG and the callouts under $STYLEIMG/callouts/. Note that in DocBook upstream admonitions are disabled by default and that low resolution PNGs are used when acticvated. Consider using the following parameters on the DAPS command line or use PARAM/STRINGPARAM in the DC-file to override: -param="admon.graphics=1" --stringparam="admon.graphics.extension=.svg"
Problem description
I created a custom style sheet inside the
xslt/fo
directory and enabled graphical admonitions and draft mode, but even though I created thestatic/images
directory insidexslt/fo
, neither the draft watermark nor the graphical admonitions are displayed. 😢Got this output:
Expected behavior
The expected behavior is the pdf with draft watermark and graphics admonitions
Steps to reproduce problem
Create a
xslt/fo/docbookc.xsl
enable graphic admonitionsCreate
xslt/fo/static/images
(a symbolic link to /usr/share/xml/docbook/stylesheet/nwalsh/images)Just in case create
xslt/fo/images
(a symbolic link to /usr/share/xml/docbook/stylesheet/nwalsh/images)Edit DC file and add:
Run:
daps -vvvv -d DC-QPortal-Producto-HLD pdf --remarks
What am I doing wrong?
Thanks in advance
Nomar
The text was updated successfully, but these errors were encountered: