Removing SVG icon in thead of hazardstatements in PDF
Post here questions and problems related to editing and publishing DITA content.
Removing SVG icon in thead of hazardstatements in PDF
Dear Oxygen team,
I would like to hide the little svg icon that always appears in the header of a hazard statement. I can use all css codes (see below), which works fine for HTML but not for PDF. Could you please give me a hint on how to hide this icon for pdf output?
I have tried almost everything but it remained untouched. All these codes work for html, but not for pdf:
OR
OR
Thank you in advance!
Best regards!
I would like to hide the little svg icon that always appears in the header of a hazard statement. I can use all css codes (see below), which works fine for HTML but not for PDF. Could you please give me a hint on how to hide this icon for pdf output?
I have tried almost everything but it remained untouched. All these codes work for html, but not for pdf:
Code: Select all
.hazardstatement th svg {
display:none;
}
Code: Select all
.hazardstatement thead tr th svg {
display:none;
}
Code: Select all
.hazardstatement thead svg:first-of-type {
display:none;
}
Thank you in advance!
Best regards!
- svg-icon-in-th.PNG (4.48 KiB) Viewed 225 times
Last edited by Sergio_7 on Wed Dec 11, 2024 2:55 pm, edited 2 times in total.
-
- Posts: 601
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Removing SVG icon in thead of hazardstatements
Post by julien_lacour »
Hello,
If you followed our user guide topic you should just remove/comment the following property:
Regards,
Julien
If you followed our user guide topic you should just remove/comment the following property:
Code: Select all
/* Show logo in the header. */
*[othertype ~= "HIGH_VOLTAGE"] .hazardstatement--other::before {
padding: .5rem;
/*content: url("electricity_icon.svg");*/
}
Julien
Re: Removing SVG icon in thead of hazardstatements
Hi Julien,
Thank you for your reply. I don't use customized symbols, I just want to remove the standard symbols that are always generated with types like “Warning”, “Caution” etc. All my efforts were unsuccessful with these attempts:
Thanks!
Thank you for your reply. I don't use customized symbols, I just want to remove the standard symbols that are always generated with types like “Warning”, “Caution” etc. All my efforts were unsuccessful with these attempts:
Code: Select all
.hazardstatement--warning::before {
display: none;
content: none;
}
Code: Select all
.hazardstatement_warning td:first-of-type {
display: none;
content: none;
}
Code: Select all
.hazardstatement td:first-of-type {
display: none;
content: none;
}
Code: Select all
.hazardstatement th:first-of-type {
display: none;
content: none;
}
Code: Select all
*[type ~= "warning"] .hazardsymbol {
display: none;
content: none;
}
- svg-icon-in-th.PNG (4.48 KiB) Viewed 228 times
Last edited by Sergio_7 on Wed Dec 11, 2024 2:52 pm, edited 5 times in total.
Re: Removing SVG icon in thead of hazardstatements
- svg-icon-in-th.PNG (4.48 KiB) Viewed 209 times
thanks for your reply. I have read the section and it is not working on my site.
Please check if this CSS code works correctly for PDF to remove the small icon in the header of the warning before the “Warning” hazard statement:
Code: Select all
.hazardstatement_warning .hazardstatement--logo-col {
display: none;
}
.hazardstatement_warning th {
table-column-span: 1
}
.hazardstatement_warning td:first-of-type {
display: none;
}
Thanks!
-
- Posts: 601
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Removing SVG icon in thead of hazardstatements in PDF
Post by julien_lacour »
Hello,
Currently this is only possible using an XSLT Extension Point:
Regards,
Julien
Currently this is only possible using an XSLT Extension Point:
- Create an XSLT stylesheet with the following content:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:svg="http://www.w3.org/2000/svg" exclude-result-prefixes="xs svg" version="3.0"> <xsl:template match="tr[1]" mode="hazard-table"> <colgroup> <col class="hazardstatement--logo-col"/> <col class="hazardstatement--msg-col"/> </colgroup> <thead> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="#current"/> </xsl:copy> </thead> </xsl:template> <xsl:template match="svg:svg" mode="hazard-table"> <span class="hazardsymbol-container"> <xsl:copy-of select="."/> </span> </xsl:template> </xsl:stylesheet>
- Declare the stylesheet as merged2html5 extension:
Code: Select all
<xslt> <extension file="custom.xsl" id="com.oxygenxml.pdf.css.xsl.merged2html5"/> </xslt>
- Hide the logo with the following CSS rule:
Code: Select all
.hazardsymbol-container { display: none; }
Regards,
Julien
-
- Posts: 601
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Removing SVG icon in thead of hazardstatements in PDF
Post by julien_lacour »
Hello,
I added an improvement so that in Oxygen 27.1 you will just need to set the CSS, the symbol will be wrapped by default in the output.
I will notify this thread once the improvement will be available, if you do the update you will be able to remove the XSLT stylesheet from your publishing template and only keep the CSS.
Regards,
Julien
I added an improvement so that in Oxygen 27.1 you will just need to set the CSS, the symbol will be wrapped by default in the output.
I will notify this thread once the improvement will be available, if you do the update you will be able to remove the XSLT stylesheet from your publishing template and only keep the CSS.
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
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