Page 1 of 1

No xml tags are displaying in print

Posted: Fri Dec 23, 2022 12:01 pm
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

Re: No xml tags are displaying in print

Posted: Fri Dec 23, 2022 12:33 pm
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

Re: No xml tags are displaying in print

Posted: Fri Dec 23, 2022 1:33 pm
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

Re: No xml tags are displaying in print

Posted: Fri Dec 23, 2022 3:15 pm
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

Re: No xml tags are displaying in print

Posted: Fri Dec 23, 2022 3:43 pm
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

Re: No xml tags are displaying in print

Posted: Tue Dec 27, 2022 11:24 am
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;
  }
}

Re: No xml tags are displaying in print

Posted: Wed Dec 28, 2022 5:55 pm
by shilpa
Hi Dumitru,
Its working.. Thank you so much..

Re: No xml tags are displaying in print

Posted: Mon Mar 06, 2023 2:31 pm
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

Re: No xml tags are displaying in print

Posted: Mon Mar 06, 2023 3:00 pm
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

Re: No xml tags are displaying in print

Posted: Tue Mar 07, 2023 10:01 am
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

Re: No xml tags are displaying in print

Posted: Tue Mar 07, 2023 11:51 am
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

Re: No xml tags are displaying in print

Posted: Thu Mar 16, 2023 12:21 pm
by shilpa
Thank you Cristian..
It's working.

Re: No xml tags are displaying in print

Posted: Wed May 08, 2024 9:52 am
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

Re: No xml tags are displaying in print

Posted: Wed May 08, 2024 6:10 pm
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 11:24 am
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 12:34 pm
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 2:31 pm
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 3:12 pm
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 4:13 pm
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

Re: No xml tags are displaying in print

Posted: Tue May 14, 2024 5:09 pm
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

Re: No xml tags are displaying in print

Posted: Wed May 15, 2024 2:24 pm
by MWdal
Right that made the trick, works fine now!
Many thanks Julien.
regards, Mikael