No xml tags are displaying in print

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

No xml tags are displaying in print

Post by shilpa »

Hi team,

We have print action in web author.
image.png
when we click on print action, tags, attributes and few css are not adding to the print document.
Below is the image for reference.
Please let us know what needs to be done to get tags , attributes and css
image.png
You do not have the required permissions to view the files attached to this post.
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: No xml tags are displaying in print

Post by mihaela »

Hello,

Please give us more details about what you need to appear in the printed output.
Also, you can try the Web Author PDF Plugin, maybe the output is closer than what you expect.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Thanks Mihaela for the response.

Actually when we click print , the pdf should include all the tags with attributes and also the css styles need to be added. Please find the below screenshot for the reference
image.png
I have uploaded the plugin which you mentioned, after that i am getting below error when i click on print

image.png
You do not have the required permissions to view the files attached to this post.
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: No xml tags are displaying in print

Post by cristi_talau »

Now I understand that you want to have the element tag markers (that display the element tag name and its attributes) visible when you print the current document.
To make the tag markers visible you can add the following rule to your CSS used to customize the Web Author UI (not the CSS in the framework)

Code: Select all

@media print {
  .tag-full.tag-full {
    display: inline !important;
  }
}
The PDF Plugin does not have an option to display the tag markers. However, if you want to troubleshoot the error you are getting, it would help to look in the server logs for a stack trace.

Best,
Cristian
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Hi Chtistian,
Thanks for the response.

After applying the css now i am getting tag and attributes like below. But i need the same way like how it display in UI
image.png
You do not have the required permissions to view the files attached to this post.
Bogdan Dumitru
Site Admin
Posts: 172
Joined: Tue Mar 20, 2018 5:28 pm

Re: No xml tags are displaying in print

Post by Bogdan Dumitru »

Hello,

To overcome this, specify the "-webkit-print-color-adjust:exact;" CSS property.
So the complete CSS would be:

Code: Select all

@media print {
  .tag-full.tag-full {
    display: inline !important;
    -webkit-print-color-adjust:exact;
  }
}
Bogdan Dumitru
http://www.oxygenxml.com
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Hi Dumitru,
Its working.. Thank you so much..
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Hi Team,

Print is not working if we add below code in plugin.js file and getting below script error when we click Print icon in web author.
workspace.getViewManager().uninstallView('review-panel-list');

workspace-99b461af0a.js:1905 TypeError: Cannot read properties of null (reading 'cloneNode')
at Fa.addReviewItems (workspace-99b461af0a.js:1967:189743)
at Fa.actionPerformed (workspace-99b461af0a.js:1967:190482)
at o.actionPerformed (workspace-99b461af0a.js:1905:124014)
at fi.executeAction (workspace-99b461af0a.js:1905:125977)
at F.executeAction_ (workspace-99b461af0a.js:1928:177333)
at F.scheduleImmediately_ (workspace-99b461af0a.js:1928:176044)
at F.schedule (workspace-99b461af0a.js:1928:175848)
at bl.executeAction (workspace-99b461af0a.js:1929:99614)
at ft.performActionInternal (workspace-99b461af0a.js:1906:16310)
at goog.ui.Control.handleMouseUp (workspace-99b461af0a.js:1228:167)


Please let us know any other method to hide or remove the review panel view from web author.

Thanks & Regards
Shilpa.P
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: No xml tags are displaying in print

Post by cristi_talau »

Hello,

Thanks for reporting this issue. It will be fixed in Web Author version 25.1 which is planned to be released soon.
As a temporary workaround you can create an HTML element with the ID: "review-panel-list" as in the code snippet below:

Code: Select all

var div = document.createElement('div');
div.id = 'review-panel-list'
document.body.append(div)
Best,
Cristian
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Thanks Cristian, It's working now.

When we print, the font color is rendering but background color is not rendering.
Please find the below images.
Below image from the web author where both font and background colors are present.
image.png
Below image from the print where only font color has rendered where as background color is not.
image.png
and the css which we used is below
@media print {
.tag-full.tag-full {
display: inline !important;
-webkit-print-color-adjust:exact;
}
}

please let us know the css to display of background color in print..

Regards
Shilpa.P
You do not have the required permissions to view the files attached to this post.
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: No xml tags are displaying in print

Post by cristi_talau »

Hello,
You can try to use the "-webkit-print-color-adjust:exact;" property on all elements:

Code: Select all

* {
  -webkit-print-color-adjust:exact !important;
}
Best,
Cristian
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Re: No xml tags are displaying in print

Post by shilpa »

Thank you Cristian..
It's working.
MWdal
Posts: 33
Joined: Thu Jun 09, 2022 2:49 pm

Re: No xml tags are displaying in print

Post by MWdal »

Hello,
is it possible to show tags in pdf also for pdf css transformation scenario?
And is it possible to select to show only certain tags?
Br, Mikael
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: No xml tags are displaying in print

Post by julien_lacour »

Hello,

If you want to display the XML tags, you can add the following rules in your CSS stylesheet(s):

Code: Select all

*:not([class ~= "topic/table"]):not([class ~= "topic/row"])::before(1000) {
  display: inline;
  content: "<" oxy_name() ">";
}
*:not([class ~= "topic/table"]):not([class ~= "topic/row"])::after(1000) {
  display: inline;
  content: "</" oxy_name() ">";
}
This example works for DITA documents transformed using the DITA Map PDF - based on HTML5 & CSS scenario.
You can use similar rules for Docbook or basic XML files, just remember to exclude tables and rows from the selector, the transformation will fail otherwise. For example you will obtain selectors like *:not(table):not(row)::before(1000) for Docbook.

If you were talking about PDF accessibility tags, you can read the following topics: Regards,
Julien
MWdal
Posts: 33
Joined: Thu Jun 09, 2022 2:49 pm

Re: No xml tags are displaying in print

Post by MWdal »

Thanks Julien, works perfectly. Yes we are using DITA Map PDF - based on HTML5 & CSS scenario.
Is it also possible to show the value of an attribute in the generated pdf, the id attribute in our case?

Br, Mikael
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: No xml tags are displaying in print

Post by julien_lacour »

Hello,

Sure you can, besides the rule I gave you previously you can add the following one:

Code: Select all

*:not([class ~= "topic/table"]):not([class ~= "topic/row"])[oid]::before(1000) {
  display: inline;
  content: "<" oxy_name() " id=\"" attr(oid) "\">";
}
Regards,
Julien
MWdal
Posts: 33
Joined: Thu Jun 09, 2022 2:49 pm

Re: No xml tags are displaying in print

Post by MWdal »

That works nicely on topics, but not on other elements, a note for example.
I also tried the second code set without the first one, with the same result: it shows the id:s for topics.

/Mikael
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: No xml tags are displaying in print

Post by julien_lacour »

Hello Mikael,

You're right, for all elements having an ID in the DITA source you need to replace the previous rule by this one:

Code: Select all

@namespace nd url('http://www.oxygenxml.com/css2fo/named-destinations');

*:not([class ~= "topic/table"]):not([class ~= "topic/row"])[nd|nd-id]::before(1000) {
  display: inline;
  content: "<" oxy_name() " id=\"" attr(nd|nd-id) "\">";
}
Regards,
Julien
MWdal
Posts: 33
Joined: Thu Jun 09, 2022 2:49 pm

Re: No xml tags are displaying in print

Post by MWdal »

I'm getting a parse error for the @namespace line. Could that be due to our oxygen is in restricted environment with no internet access?
/Mikael
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: No xml tags are displaying in print

Post by julien_lacour »

Hello Mikael,

I don't think so, as detailed in the specification:
Any @namespace rules must follow all @charset and @import rules and precede all other non-ignored at-rules and style rules in a style sheet.
So you need the rule to be at the beginning of your stylesheet.

Regards,
Julien
MWdal
Posts: 33
Joined: Thu Jun 09, 2022 2:49 pm

Re: No xml tags are displaying in print

Post by MWdal »

Right that made the trick, works fine now!
Many thanks Julien.
regards, Mikael
Post Reply