Pages: « 1 2 3 4 5 6 7 8 9 10 »
 41 
 on: October 23, 2017, 05:27:35 PM 
Started by C4 - Last post by mag3737
I think we might need a little more context here. For example:

- What is the parent of the autovalue element?
- Is there any other markup structure involved here?
- Where might the user's cursor/highlight be located when this operation is performed?

I tried out your code to remove the tags from <b> elements within paragraphs (changing "autovalue" to "b"), and the code worked fine if the cursor was placed anywhere before the first <b> and then executed repeatedly. Each execution deleted the next set of <b> tags it found. The <p> was never removed.

 42 
 on: October 23, 2017, 04:51:36 PM 
Started by C4 - Last post by C4
Hi,

I am using XMetaL Author Essential 11

I am trying to delete an element and it is a child of another element. I am using this code but when it finds the last instance of this element, it deletes the parent element as well. How do I stop this from happening?

<MACRO name="RemoveAutovalue" key="Ctrl+Shift+A" lang="JScript"><![CDATA[
var rng=ActiveDocument.Range;
rng.MoveToElement("autovalue",true);
rng.Select();
if (Selection.CanRemoveContainerTags) {
Selection.RemoveContainerTags();
}
]]></MACRO>

Thanks

 43 
 on: October 17, 2017, 07:35:07 AM 
Started by scott44 - Last post by scott44
Hi Derek,

I was off on another task, but now back on this one.  Many thanks for your replies.  I am going to submit an excerpt of the table portion of our schema and sample XML.

 44 
 on: October 10, 2017, 06:09:19 PM 
Started by jodekirk - Last post by Derek Read
If you put the following into an event macro named On_Document_Open_Complete inside the document-level MCR file for your customization, or in an event macro named On_Application_Document_Open_Complete for an application-level MCR file (one in Startup) you will be part way there.

Code:
var nodes = ActiveDocument.getNodesByXPath("//image");
var tooManyImagesForMe = 200;
if(nodes.length > tooManyImagesForMe) {
var response = Application.MessageBox("This document has a lot of images.\nWould you like to disable image rendering?\n\n(this is a global setting that affects all documents)",36);
if(response == 6) { //6 = yes
//turn "show inline images" off
Application.IniVariable("show_inline_images") = "false";
}
}

Answers to some (anticipated) questions:

1. This is using the global setting (as set in Tools > Options on the View menu) and so it affects all documents, currently open or to be opened. User can turn it back on in Tools > Options.

2. You might want to re-enable the setting when the document is closed. If not, the user needs to go into Tools > Options and enable it themselves. The logic for that might be to simply call Application.IniVariable("show_inline_images") = "true"; However, if you have two such documents open then, without additional logic, closing one would re-enable the setting and the other doc would then have its images rendered. So, you'd probably want to store another global variable somewhere that keeps track of how many such documents are open. Then when the last one is closed you would enable the setting (probably in the On_Document_Close event). Or you might provide a separate macro for the user to run to toggle the feature back on. You might also want to turn the setting back on when XMetaL Author shuts down.

3. An alternative method for doing this, specifically for SVG or other image types that are not drawn natively, might be to add logic into the On_Should_Create event that tells XMetaL Author whether to run the code in On_Initialize for the ActiveX control that renders your SVG (which is probably Internet Explorer). This would then only affect SVG images. You would probably have a similar macro to what I've listed above, but instead of toggling inline images off it would just check how many of a given element there are (same logic as above) then set some variable you choose that means "don't draw SVG images for this document" (you may need to use the CustomDocumentProperties API to pass values between macros). Then your On_Should_Create macro could check to see if that value is set to "don't draw SVG images for this document" and if it is then On_Should_Create would be set to "false" (which means that On_Initialize won't run). The On_Should_Create will run very briefly for every image in the document, so it might be very slightly slower than turning show_inline_images off, but when compared to instantiating 1000 embedded copies if Internet Explorer it should

 45 
 on: October 10, 2017, 01:57:23 PM 
Started by jodekirk - Last post by Derek Read
If you know you are going to be opening this document the easiest way to do this would be to turn off the "show inline images" setting beforehand. That's in the Tools > Options dialog on the View tab.

There is likely a way (I haven't tried to write the script code) to count the number of specific elements in a document after it has been opened and before it has been rendered but I don't know if there is a way to turn "show inline images" off through an API at that point.

 46 
 on: October 10, 2017, 10:28:32 AM 
Started by jodekirk - Last post by jodekirk
Sometimes I want to open a very large manual that has over 1,000 images. This causes XMetaL to take about 30 minutes to display anything. I can't close the document until it finishes opening, so it is faster to force XMetaL to Close using Task Manager.

Is there a way to dynamically hide all images if there are more than 100 images in the document?
If it skips loading all images for large docs it would open much faster. We use SVG and SVGZ images.

 47 
 on: September 26, 2017, 02:19:55 AM 
Started by Mythri - Last post by Mythri
Thank you, Derek. I will submit a case to XMetal Support.

Regards,
Mythri

 48 
 on: September 25, 2017, 01:45:25 PM 
Started by Mythri - Last post by Derek Read
Lots of things could be at issue here. You might want to submit a support case to XMetaL Support.

To start, it would help to know the following:

1. The version of XMetaL Author Enterprise you have installed.
2. The version of XMetaL Author Enterprise for Sharepoint that you have installed.
3. The version of Windows you are running.
4. The version of Sharepoint running on your server.
5. The Sharepoint URL that you are using (this is why I recommend dealing with this issue via XMetaL Support and not publicly on this forum).
6. Are you prompted to log in?
7. Are you using a valid login? To test that you can log in using the web interface or another application that supports Sharepoint.

 49 
 on: September 25, 2017, 06:10:43 AM 
Started by Fa - Last post by Fa
Thank you Derek!

As I suspected, my plugin is not using XEP, but FOP. Even with the RenderX folder renamed it produces the same layout.

This might explain why the xmfo plugin recognizes "Sans", and my custom plugin requires "sans-serif". My custom plugin only uses sans-serif, serif and monospaced, I have no reference to any font name, so the "fallback" fonts are probably those you cited, referenced in the pdf2 plugin.

I have tried changing throughout my plugin all fop references to xep references, but that breaks the output.

The files I have modified are:

xsl/fo/topic2fo_shell_fop.xsl renamed to xsl/fo/topic2fo_shell_xep.xsl (I have also modified the integrator.xml file reference to the file to reflect this name change) and modified as follows:

Code:
  <xsl:import href="plugin:org.dita.pdf2.fop:cfg/fo/attrs/commons-attr_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:cfg/fo/attrs/tables-attr_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:cfg/fo/attrs/toc-attr_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:xsl/fo/root-processing_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:xsl/fo/index_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:xsl/fo/tables_fop.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.fop:xsl/fo/flagging_fop.xsl" />

Changed to

Code:
   <xsl:import href="plugin:org.dita.pdf2.xep:cfg/fo/attrs/commons-attr_xep.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.xep:cfg/fo/attrs/layout-masters-attr_xep.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.xep:xsl/fo/root-processing_xep.xsl" />
  <xsl:import href="plugin:org.dita.pdf2.xep:xsl/fo/index_xep.xsl" />


In cfg/fo/attrs/basic-settings.xsl, I changed the line
Code:
  <xsl:param name="pdfFormatter" select="'fop'" />

to

Code:
  <xsl:param name="pdfFormatter" select="'xep'" />

Are there some files at a higher level (e.g. DITA_OT level) that would require editing for this to work, or is this the wrong approach?

Also, should I define another plugin under "require" in plugin.xml? Currently it is set to
Code:
  <require plugin="org.dita.pdf2" />

Thank you!


 50 
 on: September 25, 2017, 01:00:13 AM 
Started by Mythri - Last post by Mythri
Hello,

I have configured the repository options with the Sharepoint URL. However, after following the steps provided in the XMetal Author Enterprise - SP Edition help, I was unable to connect to the Sharepoint location due to the following error:

The request failed with HTTP status 401: Unauthorized.

Can you please help me to resolve this?

Regards,
Mythri

 

Pages: « 1 2 3 4 5 6 7 8 9 10 »
email us