Path to image from Cover Page for PDF
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Path to image from Cover Page for PDF
Post by shudson310 »
Hi,
In our PDFs for every product we have different product logo on the cover page. How can I set the path to these images so that whenever I generate PDF out the correct logo is picked?
In the XML we have:
In the merged HTML, it seems the path to the keyref is not resolved properly:
And in the CSS, we have:
How can we get the project icon to display on the cover?
In our PDFs for every product we have different product logo on the cover page. How can I set the path to these images so that whenever I generate PDF out the correct logo is picked?
In the XML we have:
Code: Select all
<image id="image_Project_icon" keyref="fg_Icon"
align="right">
<alt>Project icon</alt>
</image>
Code: Select all
<div name="cover-image" class="- topic/data data">
<div align="right" audience="CA" format="png" href="oxy_ex-1/media/JPse/fg_Icon.png" id="_Connect_42_image_Project_icon" keyref="fg_Icon" placement="inline" class="- topic/image image">
<div class="- topic/alt alt">Project icon</div>
</div>
</div>
Code: Select all
:root {
string-set:
coverImage oxy_xpath("//*[contains(@class, 'topic/data')][@name='cover-image']/div/@href");
@page front-page {
@top-left {
content: url("../../images/logo.print.png");
max-width: 0.5in;
padding-top: 20pt;
}
@bottom-right {
content: url(string(coverImage));
}
}
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Path to image from Cover Page for PDF
Hi Scott,
Unfortunately, it is not very clear what is the specific context where you insert the image reference into your source DITA document.
I am asking this as I find it a bit weird that the image you refer in your document ends up inside a <div/> element in the merged HTML document, instead of an <img/> element with an ID attribute.
Could you please provide more details?
Have you tried using the oxy_xpath function directly in "content: " instead of using the string-set variable and see if this changes anything?
We will investigate to see if building content over a URL with string-set could also be possible.
Meanwhile, as a workaround you should create multiple transformation scenarios using different publishing templates - each product should have its own publishing template file.
For example, you could have a template that would include the basic CSS and different templates referring product-specific CSS files.
Regards,
Costin
Unfortunately, it is not very clear what is the specific context where you insert the image reference into your source DITA document.
I am asking this as I find it a bit weird that the image you refer in your document ends up inside a <div/> element in the merged HTML document, instead of an <img/> element with an ID attribute.
Could you please provide more details?
Have you tried using the oxy_xpath function directly in "content: " instead of using the string-set variable and see if this changes anything?
We will investigate to see if building content over a URL with string-set could also be possible.
Meanwhile, as a workaround you should create multiple transformation scenarios using different publishing templates - each product should have its own publishing template file.
For example, you could have a template that would include the basic CSS and different templates referring product-specific CSS files.
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Path to image from Cover Page for PDF
Post by shudson310 »
Each of our projects has a logo that is specified in the bookmap:
<data name="cover-image"><image id="project_icon" keyref="project_icon" align="right">
<alt>Project icon</alt>
</image></data>
</metadata>
That keyref gets resolved to an href in the merged.html:
<div name="cover-image" class="- topic/data data"><div align="right" format="png" href="media/project_icon.png" id="_Connect_42_project_icon" keyref="project_icon" placement="inline" class="- topic/image image">
<div class="- topic/alt alt">Project icon</div>
</div></div>
</div>
But I’m not able to get the logo to display. I’ve tried:
@page front-page {
@top-left { image-resolution: 300dpi;
content: url("../../images/companylogo.print.png");
max-width: 0.5in;
padding-top: 20pt;
}
@bottom-right {
background-image:url("oxy_xpath('//*[contains(@class, "topic/data")][@name="cover-image"]/div/@href')");
background-repeat:no-repeat;
}
And
@page front-page {
@top-left { image-resolution: 300dpi;
content: url("../../images/companylogo.print.png");
max-width: 0.5in;
padding-top: 20pt;
}
@bottom-right {
image-resolution: 300dpi;
content: url("oxy_xpath('//div[parent::div[@name="cover-image"]]/@href')");
}
}
It looks like the image is copied during processing in the log, but the image still won't display.
<data name="cover-image"><image id="project_icon" keyref="project_icon" align="right">
<alt>Project icon</alt>
</image></data>
</metadata>
That keyref gets resolved to an href in the merged.html:
<div name="cover-image" class="- topic/data data"><div align="right" format="png" href="media/project_icon.png" id="_Connect_42_project_icon" keyref="project_icon" placement="inline" class="- topic/image image">
<div class="- topic/alt alt">Project icon</div>
</div></div>
</div>
But I’m not able to get the logo to display. I’ve tried:
@page front-page {
@top-left { image-resolution: 300dpi;
content: url("../../images/companylogo.print.png");
max-width: 0.5in;
padding-top: 20pt;
}
@bottom-right {
background-image:url("oxy_xpath('//*[contains(@class, "topic/data")][@name="cover-image"]/div/@href')");
background-repeat:no-repeat;
}
And
@page front-page {
@top-left { image-resolution: 300dpi;
content: url("../../images/companylogo.print.png");
max-width: 0.5in;
padding-top: 20pt;
}
@bottom-right {
image-resolution: 300dpi;
content: url("oxy_xpath('//div[parent::div[@name="cover-image"]]/@href')");
}
}
It looks like the image is copied during processing in the log, but the image still won't display.
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Path to image from Cover Page for PDF
Hi Scott,
We looked into this and unfortunately the the oxy_xpath function does not work for the page-margin box.
It should though, so an improvement request was added internally.
Therefore, this will be implemented in a future version of oXygen, but until then I'm afraid the only workaround is to work with multiple transformation scenarios using their own different CSS, like I suggested previously.
Regards,
Costin
We looked into this and unfortunately the the oxy_xpath function does not work for the page-margin box.
It should though, so an improvement request was added internally.
Therefore, this will be implemented in a future version of oXygen, but until then I'm afraid the only workaround is to work with multiple transformation scenarios using their own different CSS, like I suggested previously.
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 156
- Joined: Sat Feb 26, 2005 12:09 am
- Location: USA
- Contact:
Re: Path to image from Cover Page for PDF
Post by shudson310 »
We follow the best practice from topic5247.html
The bookmeta contains a data element with the keyref to the image. We have a separate sub map that resolves that keyref to in image in the project directory.
I don't want to maintain separate stylesheets for every project, so we eagerly wait for this feature to be supported.
Thanks,
--Scott
The bookmeta contains a data element with the keyref to the image. We have a separate sub map that resolves that keyref to in image in the project directory.
I don't want to maintain separate stylesheets for every project, so we eagerly wait for this feature to be supported.
Thanks,
--Scott
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Staff Content Engineer
Site: docs.servicenow.com
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