SVG obhect centering issue
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 33
- Joined: Tue Feb 20, 2018 2:51 pm
SVG obhect centering issue
Post by anna_craneo »
Hi, I'm using DITA-PDF (WYSISYG) transformation with CSS via PDF chemistry.
I want my logo to be at the top center of the front page.
For better quality I want to use .svg object, not a regular image.
The issue is that it does not work for svg, object is always at the top-left position:
Though it is ok for images:
How can I center svg?
I want my logo to be at the top center of the front page.
For better quality I want to use .svg object, not a regular image.
The issue is that it does not work for svg, object is always at the top-left position:
Code: Select all
@page front-page {
@top-left-corner {
content: none
}
@top-left {
content: none
}
@top-center {
content: url("..\img\my-logo.svg");
margin: auto;
display:block;
}
Code: Select all
@page front-page {
@top-left-corner {
content: none
}
@top-left {
content: none
}
@top-center {
content: url("..\img\my-logo.png");
margin: auto;
display:block;
}
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: SVG obhect centering issue
Hello Anna,
Your CSS is good, it works for me when I refer a small-size SVG sample. Can you send us an SVG that exhibits the problem? You can use the technical support form.
The lines:
are not necessary, the content of a @top-center page margin box has the property "text-align" set to "center".
Another way of using an image is to set it as a background image of the page:
Best regards,
Dan
Your CSS is good, it works for me when I refer a small-size SVG sample. Can you send us an SVG that exhibits the problem? You can use the technical support form.
The lines:
Code: Select all
margin: auto;
display:block;
Another way of using an image is to set it as a background image of the page:
Code: Select all
@page front-page {
background-image:url("some.svg");
background-position:50% 5%; /* the first is the alignement on the X axis, the second, on Y.*/
background-repeat:no-repeat;
@top-left-corner {
.....
}
....
}
Dan
-
- Posts: 33
- Joined: Tue Feb 20, 2018 2:51 pm
Re: SVG object centering issue
Post by anna_craneo »
Hi,
Thanks for the tip. First way works okay with small images (<300 px) but is not applicable for the bigger ones.
Thanks for the tip. First way works okay with small images (<300 px) but is not applicable for the bigger ones.
Return to “General XML Questions”
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