Applying a class to SVG
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
Applying a class to SVG
I'm experimenting with embedding SVG in my docs. Found a probable bug with Chemistry.
I've the following
The class "fontfab" is defined
After building with Chemistry, the SVG appears in the PDF at its viewBox size, ignoring the CSS.
Tried changing the height/width definitions to points to no avail. The CSS was still ignored.
Embedding the height/width values in the <svg> tag works but breaks my HTML output.
Is this a known bug? Is there a workaround?
I've the following
Code: Select all
<svg-container id="opt-svg">
<svg class="fontfab" fill-rule="evenodd" clip-rule="evenodd"
stroke-linejoin="round" stroke-miterlimit="1.414" viewBox="0 0 512 512"
xmlns="http://www.w3.org/2000/svg">
<path
d="M493.716 438.858H347.43c-7.227 0-19.49-4.256-22.424-10.86l-141.46-295.426H18.286C8.188 132.572 0 112.956 0 102.858c0-10.099 8.188-29.715 18.286-29.715h182.857c7.227 0 19.49 4.256 22.425 10.86l141.46 295.427h128.688c10.1 0 18.285 19.615 18.285 29.714 0 10.1-8.186 29.714-18.285 29.714zm0-306.286H310.858c-10.1 0-18.286-19.616-18.286-29.714 0-10.099 8.187-29.715 18.286-29.715h182.858c10.1 0 18.285 19.616 18.285 29.715 0 10.098-8.186 29.714-18.285 29.714z"
fill-rule="nonzero"/>
</svg>
</svg-container>
Code: Select all
svg.fontfab{
height: 0.8em;
width: 0.8em;
}
Tried changing the height/width definitions to points to no avail. The CSS was still ignored.
Embedding the height/width values in the <svg> tag works but breaks my HTML output.
Is this a known bug? Is there a workaround?
Re: Applying a class to SVG
Thank you for reporting this!
Yes, this is a limitation, we will try to find a solution for this. For the moment I see no easy workaround, except trying to alter all the SVG from the documentation using the oXygen refactoring actions in a form that is acceptable for both the print and web formats.
Another way would be to write some XSLT extensions:
https://www.oxygenxml.com/doc/ug-pdf-cs ... sions.html
Many regards,
Dan
Yes, this is a limitation, we will try to find a solution for this. For the moment I see no easy workaround, except trying to alter all the SVG from the documentation using the oXygen refactoring actions in a form that is acceptable for both the print and web formats.
Another way would be to write some XSLT extensions:
https://www.oxygenxml.com/doc/ug-pdf-cs ... sions.html
Many regards,
Dan
Re: Applying a class to SVG
I've found a workaround using an ANT replaceregexp - fortunately the class="fontfab" is easy to find:
Thanks for the confirmation, Dan. Hope you guys come up with a better fix than my kludge.
Code: Select all
<replaceregexp file="${pub.dir}/index.html" flags="gs" match="class="fontfab""
replace="height="9pt" width="9pt"" byline="true"/>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service