Images not displaying in pdf-css transform
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Images not displaying in pdf-css transform
Post by dmotiosaia »
I was able to use an external graphic of cover art by adding a couple of custom CSS sheets, but I'm having two issues with it:
1) I can overlay text (mainbooktitle and booktitle alt) atop the external graphic and can place it using absolute positioning, However, I cannot change the color of the text. I need to make it white, to show up against a colored background in the cover art graphic, but no matter where I put the 'color: white;' attribute, it doesn't seem to apply.
2) Now that I've added the external graphic, all other images are not displaying. Here are my two CSS sheets:
1) First, the smaller, product-specific CSS, which calls the larger, default PDF:
Code: Select all
@import url("./Topics/Reuse/MainReuse/motiopdfs.css");
@page front-page {
size:us-letter;
margin-top:1in;
background-image:url("./Topics/Images/MotioPI_USER_GUIDE.tif");
background-position: top 76px;
background-repeat:no-repeat;
}
div.cover {
page: cover;
}
Code: Select all
@font-face{
font-family:"Myriad Pro",sans-serif;
src: url(./fonts/Myriad-Pro_31655.ttf);
}
@font-face{
font-family:"Myriad Pro-Italic",sans-serif;
src: url(./fonts/Myriad-Pro-Italic_31634.ttf)
}
@font-face{
font-family:"Myriad Pro-Bold",sans-serif;
src: url(./fonts/Myriad-Pro-Bold_31631.ttf)
}
@font-face{
font-family:"Myriad Pro-Semibold",sans-serif;
src: url(./fonts/Myriad-Pro-Semibold_31650.ttf)
}
@font-face {
font-family:"Chalet Book",sans-serif;
src: url(./fonts/ChaletBook_10032.ttf);
}
@font-face {
font-family:"Chalet Book-Bold",sans-serif;
src: url(./fonts/ChaletBook-Bold_10028.ttf);
}
front-page-title {
color: white!important;
display:block;
position:absolute;
top:447pt;
left:200pt;
}
booktitle {
color: white!important;
}
mainbooktitle { /* For ex.: "User Guide"*/
color: white!important;
font-family:"Chalet Book",sans-serif;
font-size:29pt;
line-height:29pt;
margin-bottom:0pt;
padding-bottom:0pt;
/* fwiw, this is the XPATH class: "- topic/ph bookmap/mainbooktitle" */
}
booktitlealt {
display:block;
text-align: right;
position:absolute;
top:40px;
left:-123pt;
width:4.6in;
font-family:"Chalet Book",sans-serif;
font-size:12pt;
color: white!important;
/* border: 1px solid white;*/
}
body { font-family: "Myriad Pro", arial, helvetica, sans-serif
}
bodydiv.notices {
font-family: "Myriad Pro", arial, helvetica, sans-serif;
border-left: 0.25pt solid;
margin-left:21.5em;
padding-left:1.5em;
}
section.notices {
font-family: "Myriad Pro", arial, helvetica, sans-serif;
border-left: 0.25pt solid;
margin-left:21.5em;
padding-left:1.5em;
}
shortdesc {
display: block;
font-family: "Myriad Pro-Italic",arial, helvetica, sens-serif;
margin-bottom:6pt;
}
ul {
display:block;
margin-top:6pt;
}
li {
display:list-item;
list-style-type: disc;
margin-left: 5pt;
padding-left:8pt;
padding-bottom:2pt;
}
wintitle {
font-family: "Myriad Pro-Semibold",arial, helvetica, sans-serif;
}
article, title, p {
display: block;
}
title {
font-size:24pt;
border-bottom: 1.5pt solid #ccc;
font-family:"Myriad Pro-Bold", sans-serif;
text-align:right;
font-style:bold;
padding-bottom:-8px;
letter-spacing: 0px;
line-height:24pt;
margin-bottom:18pt;
}
title.h2 {
font-size:24pt;
font-family:"Myriad Pro-Bold", sans-serif;
text-align:right;
font-style:bold;
padding-bottom:-8px;
letter-spacing: 0px;
line-height:24pt;
margin-bottom:18pt;
}
h1 {
bookmark-label: content(before) " / " content(text);
font-family:"Myriad Pro",sans-serif;
font-size: 24pt;
text-align:right;
border:none;
}
h1:before{
content: counter(chapter);
counter-increment:chapter;
}
h2 {
font-family:"Myriad Pro-Bold",sans-serif;
font-size:18pt;
bookmark-label: content(before) " / " content(text);
border-bottom: 1pt solid #ccc;
text-align: right;
}
h2 {
font-family:"Myriad Pro",sans-serif;
font-size:16pt;
bookmark-label: content(before) " / " content(text);
border-bottom: 1pt solid #ccc;
text-align: right;
}
p {
font-family:"Myriad Pro", sans-serif;
font-style:normal;
line-height:1.2;
margin-bottom:1em;
}
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
I tested the behavior based on the sample snippets you provided, but could not reproduce the second issue you reported.
What I did specifically: I created two custom CSS files - "custom.css" (as the 1st - product specific CSS) and "motiopdfs.css" (as the larger, global stylesheet, called by "custom.css"). Then I duplicated the DITA Map > PDF WYSIWYG scenario and set "custom.css" as a custom css parameter in the scenario configuration dialog. After configuring the scenario, I just applied it over the sample "taskbook.ditamap" map, from the "it-book" folder of the sample oXygen project, which I also modified first by adding some .jpeg and .tiff images prior to applying the scenario.
The .tiff background-image I set for the front-page element in the smaller CSS was a all-red .tiff image and that was successfully used as a front-page background, altogether with the other images that I previously added in some of the "it-book" topics.
Could you please also test your stylesheets on the taskbook.ditamap as and see if it works? If it does, then the problem could be specific to your specific source DITA Map. In that case, to investigate further, we would need you to send us a sample DITA Map brought to an as minimal as possible form, which would still reproduce the images issue.
Regarding the 1st problem (white not applied as the color for mainbooktitle and booktitle alt), this is indeed a known issue that we already have logged in our internal tracking system and which was already fixed in our development stream. The fix will be included in the next version of oXygen.
As this seems to happen only for the "white" color, the workaround would be to use a different color for the titles. It would suffice to use:
Code: Select all
@media print {
front-page-title {
color: #fffffe;
display:block;
position:absolute;
top:447pt;
left:200pt;
}
}
Also, the "#fffffe" is the code of the color closest to white.
I hope you'll find this helpful.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
I will look into the other issue now.
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
I will include complete copies of both stylesheets. Maybe you can find something in there that's causing images to not display?
First stylesheet:
Code: Select all
/*This is the CSS specific to MotioPI 101 UG*/
@import url("./Topics/Reuse/MainReuse/motiopdfs.css");
@media print {
@page front-page {
size:us-letter;
margin-top:1in;
background-image:url("./Topics/Images/All-Motio-USER_GUIDE_COVERs.tif");
background-position: top 76px;
background-repeat:no-repeat;
}
}
/*@media print {
div.cover {
page: cover;
}
}*/
Code: Select all
/*This is the globabl stylesheet for all Motio PDFs*/
@font-face{
font-family:"Myriad Pro",sans-serif;
src: url(./fonts/Myriad-Pro_31655.ttf);
}
@font-face{
font-family:"Myriad Pro-Italic",sans-serif;
src: url(./fonts/Myriad-Pro-Italic_31634.ttf)
}
@font-face{
font-family:"Myriad Pro-Bold",sans-serif;
src: url(./fonts/Myriad-Pro-Bold_31631.ttf)
}
@font-face{
font-family:"Myriad Pro-Semibold",sans-serif;
src: url(./fonts/Myriad-Pro-Semibold_31650.ttf)
}
@font-face {
font-family:"Chalet Book",sans-serif;
src: url(./fonts/ChaletBook_10032.ttf);
}
@font-face {
font-family:"Chalet Book-Bold",sans-serif;
src: url(./fonts/ChaletBook-Bold_10028.ttf);
}
@media print {
front-page-title {
display:block;
position:absolute;
top:447pt;
left:200pt;
}
}
@media print {
booktitle {
color: #fffffe;
}
}
@media print {
mainbooktitle { /* For ex.: "User Guide"*/
font-family:"Chalet Book",sans-serif;
font-size:29pt;
line-height:29pt;
margin-bottom:0pt;
padding-bottom:0pt;
/* fwiw, this is the XPATH class: "- topic/ph bookmap/mainbooktitle" */
}
}
@media print {
booktitlealt {
color: #F0FFFF;
display:block;
text-align: right;
position:absolute;
top:40px;
left:-123pt;
width:4.6in;
font-family:"Chalet Book",sans-serif;
font-size:12pt;
font-weight:100;
}
}
@media print {
body { font-family: "Myriad Pro", arial, helvetica, sans-serif
}
}
@media print {
bodydiv.notices {
font-family: "Myriad Pro", arial, helvetica, sans-serif;
border-left: 0.25pt solid;
margin-left:21.5em;
padding-left:1.5em;
}
}
@media print {
section.notices {
font-family: "Myriad Pro", arial, helvetica, sans-serif;
border-left: 0.25pt solid;
margin-left:21.5em;
padding-left:1.5em;
}
}
@media print {
shortdesc {
display: block;
font-family: "Myriad Pro-Italic",arial, helvetica, sens-serif;
margin-bottom:6pt;
}
}
@media print {
ul {
display:block;
margin-top:6pt;
}
}
@media print {
li {
display:list-item;
list-style-type: disc;
margin-left: 5pt;
padding-left:8pt;
padding-bottom:2pt;
}
}
@media print {
wintitle {
font-family: "Myriad Pro-Semibold",arial, helvetica, sans-serif;
}
}
@media print {
article, title, p {
display: block;
}
}
@media print {
title {
font-size:24pt;
border-bottom: 1.5pt solid #ccc;
font-family:"Myriad Pro-Bold", sans-serif;
text-align:right;
font-style:bold;
padding-bottom:-8px;
letter-spacing: 0px;
line-height:24pt;
margin-bottom:18pt;
}
}
@media print {
title.h2 {
font-size:24pt;
font-family:"Myriad Pro-Bold", sans-serif;
text-align:right;
font-style:bold;
padding-bottom:-8px;
letter-spacing: 0px;
line-height:24pt;
margin-bottom:18pt;
}
}
@media print {
h1 {
bookmark-label: content(before) " / " content(text);
font-family:"Myriad Pro",sans-serif;
font-size: 24pt;
text-align:right;
border:none;
}
}
@media print {
h1:before{
content: counter(chapter);
counter-increment:chapter;
}
}
@media print {
h2 {
font-family:"Myriad Pro-Bold",sans-serif;
font-size:18pt;
bookmark-label: content(before) " / " content(text);
border-bottom: 1pt solid #ccc;
text-align: right;
}
}
@media print {
h2 {
font-family:"Myriad Pro",sans-serif;
src: url(./fonts/ChaletBook_10032.ttf);
font-size:16pt;
bookmark-label: content(before) " / " content(text);
border-bottom: 1pt solid #ccc;
src: url(./fonts/ChaletBook_10032.ttf);
text-align: right;
}
}
@media print {
p {
font-family:"Myriad Pro", sans-serif;
font-style:normal;
line-height:1.2;
margin-bottom:1em;
}
}
/*p.notices {
font-family:"Myriad Pro", sans-serif;
font-style:normal;
line-height:1.2;
margin-bottom:1em;
border-left: 0.5pt solid;
margin-left:18em;
padding-left:2em;
}*/
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
I can't figure out how to include more than one URL, so I had to resort to importing the 2nd CSS file into the first. How do you provide more than one CSS? I tried listing the urls in a plain-text file, but that didn't work.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
Yes, this is what causes the issue.Please note that I've been adding my CSS via the dita.css.list parameter. I don't know whether that has contributed to the problem.
You should use the "argss.css" parameter instead, to pass the smaller CSS of yours, as this is what I did and worked (all other images were present and correctly displayed).
This is also the parameter suggested in our User-Guide.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
I'd attach a screenshot, but I don't see how.
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
Yes, I read that page, but it refers to webhelp scenarios. I'm working on PDF output.This is also the parameter suggested in our User-Guide
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
The issue could be related to some broken scenario, or even a broken framework. Could you please try starting from the default (clean) "DITA Map PDF - WYSIWYG" scenario, create a fresh duplicate, then edit the duplicate scenario and see if the "args.css" is present in the list of parameters?
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/DITA-OT/plugins/
/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/DITA-OT2.x/plugins/
(/home/david being where I installed Oxygen 19.1)
Note that this is a Linux install, not Windows -- could that have something to do with it?
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
Voluntary or involuntary, you might have tinkered with the default frameworks that come bundled with oXygen in the past and, somehow, you might have ended-up with a broken DITA OT 2.x framework. If I correctly understand, you wen in oXygen Options > Preferences > DITA and set a custom DITA OT folder to /home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/DITA-OT2.x/plugins/. This is not correct, as the "plugins" is just a subfolder of the main DITA-OT2.x framework, so there is no DITA framework could find in either /home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/DITA-OT/plugins/ or /home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/DITA-OT2.x/plugins/ subfolders.
The args.css parameters must be available in the default DITA-OT (DITA-OT2.x) DITA frameworks that come with oXygen XML, so you should stick with the default DITA OT location (in the Options > Preferneces > DITA, under the "DITA Open Toolkit", you should have "Built-in DITA OT 2.x" enabled, as this is the default).
What may happen is that you could have changed your default frameworks folder to a custom location. To check that, you should go into Options > Preferences > Document Type Association > Location and check that you have the default option enabled.
Otherwise, like I specified, you might have modified the default frameworks (including DITA) in oXygen, so I suggest downloading and installing a fresh copy of oXygen XML v19.1 from our website, then install it in a separate location and use the default settings.
Then retry starting from the predefined DITA Map > PDF scenario from the transformation scenarios list.
Best Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
At any rate, I can see args.css now and will set the smaller of the two (which imports the larger) CSS files there and see how it goes.
Thanks very much for your help!
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
I'm totally sure that the 2nd CSS (the "motiopdfs.css", imported by the main "custom.css" file) was used in the process.
If it would not have been used, then neither the white color would have been applied, as you performed "the #fffffe thing" over the "front-page-title" element - which is present in the "motiopdfs.css".
Given this, the font issue is most probably related to some missing fonts from your system.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
A) Include the smaller CSS file as the value for "args.css", AND the larger CSS as the value for "dita.css.list,"
Result: the PDF generates with the correct fonts but without any images.
B) Include the smaller CSS file for 'args.css' but remove the 'dita.css.list' parameter.
Result: the PDF generates without the correct fonts but with all images.
I tried to include the build output for both options, but it was way too large for this form. I will send a text file via attachment in your Support email form.
I will work on this as much as I can tomorrow, as there are only 5 days left in my 19.1 trial period, and I need to resolve this before I can recommend upgrading to 19.1.
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
- body
- bodydiv.notices
- section.notices
- shortdesc
- ul
- li
- wintitle
and the following fonts are wrong:
- front-page-title
- booktitle
- mainbooktitle
- booktitlealt
- topic:title
- title
- title.h2
- h1
- h2
I don't know whether that helps or not.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Images not displaying in pdf-css transform
Both the fonts and the images seems to be working OK, when passing the main .css file (the one that imports "motiopdfs.css") through the args.css parameter (not involving the dita.css.list parameter that supersedes the default DITA topics/maps CSS rules in oXygen - which is not the case).
To test, I downloaded the "ChaletBook_10032.ttf" font and I noticed that the "mainbooktitle" font was changed also in the PDF output.
However, I noticed that in the sample snippets you provided, you explicitly set the font only for some elements and for others you did not.
Therefore, make sure that you have the fonts installed in the operating system and that the name and path to the specific font is correctly specified in CSS for the elements you need. Double check if the font associated to an element is actually present in the specified location.
If it still does not work, please provide some sample files to reproduce the issue, together with the font .ttf files you are using.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
I will attache the DITA folder and the fonts folder as zipped archives, using the other Support Contact Us form.
Since I only have 2 days left in my 30-day trial, would it be possible to extend the trial, so that we can resolve this issue?
I think I've included all the files that you need in order to troubleshoot; if not, please let me know which additional files you need.
Note that the "MainReuse" folder is an OS-level redirect (symbolic link) that points the "Reuse" folder elsewhere in the system. But I have confirmed that all referenced fonts are installed. Remember that the fonts that are missing when generating using option B are present when generating using option A.
It occurred to me that if I'm using option B, then only one CSS file is being used, right? (that is, motiopdfs.css, because the dita.css.list parameter completely overwrites whatever is in the args.css parameter? I had been assuming that when using the dita.css.list parameter, the scenario had access to both values. So I tried copying all CSS declarations into the 'smaller' of the two CSS files (MotioPI-pdf.css) and generated. The result was the same as if I used option B.
At any rate, I will send the two zips now, via the other form.
Thanks again for your help.
-
- Posts: 15
- Joined: Mon Nov 09, 2015 10:42 pm
Re: Images not displaying in pdf-css transform
Post by dmotiosaia »
[echo] dita.css.list=file\:/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/css/edit/style-basic.css;file\:/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/css/webauthor/profiling.css;file\:/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/css/webauthor/profiling.css;/home/david/dev-projects/MotioPI/docs/DITA/MotioPI-pdf.css;file\:/home/david/Oxygen%20XML%20Editor%2019/frameworks/dita/css/webauthor/profiling.css;file\:/home/david/dev-projects/MotioPI/docs/DITA/Topics/Reuse/MainReuse/motiopdfs.css;
Why is that?
Return to “DITA (Editing and Publishing DITA Content)”
- 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