GithubHelp home page GithubHelp logo

drmacro / wordinator Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 8.0 823 KB

Generate high-quality DOCX files using a simplified XML format (simple word processing XML).

License: Apache License 2.0

CSS 0.48% Java 52.81% XSLT 23.53% HTML 23.18%

wordinator's People

Contributors

contrext avatar dependabot[bot] avatar drmacro avatar ekimbernow avatar larsga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordinator's Issues

Math support

From what I see Wordinator cant implement math transformations. I couldn't find any other information about (SWPX) online.
Would it be possible to implement math transforations, how hard it would be (optimistic hope).
Thank you for your work!

Allow turn on debug output from the command line.

A common problem (at least for me) while trying to use wordinator is styles being ignored and dropping to the default style (Body text/Normal) for the document when converting from html to docx.

This is hard to debug - it's not clear where the problem is occurring.

I notice that baseProcessing.xsl contains lots of $doDebug statements which appear to assist debugging this.

But I can't find any way of turning them on.

Please could this be enabled from the command line or similar mechanism? E.g. a command line switch or extra option.

Even if I put in some xsl:messagetest</xsl:message> statements in baseProcessing.java, these don't seem to display anything, so I'm not sure where the problem is.

Ability to include attachments in DOCX output with URL or Base64 encoded file

At present, images appear to need to be stored at the same location/server from which the Wordinator is running from, i.e. src="file:/Users/ekimber/workspace/wordinator/src/test/resources/html/images/picture-of-something.jpg" when they are referenced.

It is not possible to specify either:

  1. An absolute URL, i.e. src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/1200px-Google_2015_logo.svg.png"
  2. The base-64 encoded contents of the file itself, i.e. src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASAB..." to have used in the DOCX output.

Please could the support of both of these attachment provision methods (URL and base64 encoded file) be looked at for inclusion in the Wordinator tool.

Run after <fn> truncated

I've got the following structure in an swpx file:

<p style="IASB Normal npara" styleId="IASBNormalnpara"><run>B20</run><run><tab/></run><run>To illustrate a build‑up approach, assume that Asset A is a contractual right to receive CU800</run><fn><p style="IASB Normal" styleId="IASBNormal"><run>In this IFRS monetary amounts are denominated in ‘currency units (CU)’.</run></p></fn><run> in one year (ie there is no timing uncertainty). There is an established market for comparable assets, and information about those assets, including price information, is available. Of those comparable assets:</run></p>

When Word is generated the <run> after the <fn> (i.e. "<run> in one year ...") is dropped and no text is generated. Please check the zip attached to issue (2) and search for <fn>. There are several <fn> elements. I didn't check them all, but the first two definitely exhibit the behavior described.

Issues with column widths if colspan is used

It looks like column widths are not calculated correctly when there are columns with colspan specified.
I'm attaching a simple swpx file with two tables. The first has a colspan in the first cell, the second is based on this same table but with no colspan (and correspondingly fewer columns). Note that the first table is just a subset of a much larger table, but I've commented all body rows except the first to keep it short.
The second table has the first column of the correct width.
The first table should be the exactly the same but because of colspan the first column (spanned) is much too narrow.
test.swpx.zip

Missing Enum for JUSTIFY

A causes a crash with the following error:

[java] java.lang.IllegalArgumentException: No enum constant org.apache.poi.xwpf.usermodel.ParagraphAlignment.JUSTIFY
[java] at java.lang.Enum.valueOf(Enum.java:238)
[java] at org.apache.poi.xwpf.usermodel.ParagraphAlignment.valueOf(ParagraphAlignment.java:29)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.makeTableRow(DocxGenerator.java:2045)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.makeTable(DocxGenerator.java:1552)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.handleBody(DocxGenerator.java:372)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.handleSection(DocxGenerator.java:416)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.handleBody(DocxGenerator.java:369)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.constructDoc(DocxGenerator.java:339)
[java] at org.wordinator.xml2docx.generator.DocxGenerator.generate(DocxGenerator.java:312)
[java] at org.wordinator.xml2docx.MakeDocx.handleSingleSwpxDoc(MakeDocx.java:272)
[java] at org.wordinator.xml2docx.MakeDocx.handleDirectory(MakeDocx.java:294)
[java] at org.wordinator.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:163)
[java] at org.wordinator.xml2docx.MakeDocx.main(MakeDocx.java:69)
[java] + 2019-08-21 14:39:02,053 [ERROR] Unexpected IllegalArgumentException: No enum constant org.apache.poi.xwpf.usermodel.ParagraphAlignment.JUSTIFY

According to the rng "justify" is a valid value for align attribute on a . There must be a constants mismatch of some kind.

Provide SWPX to DOCX Comparison tool for verifying generated result

Implement within Wordinator a function that compares the input SWPX to the generated DOCX to verify:

  • All content in runs is reflected correctly in the result DOCX (i.e., a run-to-run comparison)
  • All fields are in the SWPX are reflected in the DOCX
  • Headers and footers match

It does not need to handle chunked DOCX results, meaning that it only verifies the SWPX when there is exactly one DOCX result generated from it.

For implementation, one approach would be to use XmlObject to construct cursors on the SWPX and the Document and then walk them in parallel--there should be a one-to-one alignment between paragraphs and runs modulo the effect of hyperlinks and fields, which have a slightly different (simpler) structure in SWPX than in DOCX.

Because there is not an exact alignment between formatting properties in SWPX and DOCX, doing validation on the formatting properties would be more involved and is not an immediate requirement.

The primary purpose of this comparison is to ensure that no content is being dropped or duplicated from the SWPX to DOCX.

Feature request: image data from embedded Base64

My XHTML that I am transforming into SWPX embeds all graphics as follows:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUh...XXa7Z"/>

There is no resolvable URI with which an image file can be dereferenced using the http: scheme.

It would be handy if wp:image would support the data: scheme in the src= attribute. No file management necessary. The reason I have it in my HTML is so that the HTML is a single monolithic file and not an unmanageable collection of graphics.

I would simply copy my HTML src= attribute into my SWPX src= attribute and that job would be done.

Errors log4j running form command line

Hello I tried to build run wordinator in my ubuntu18, managed to build and run the jar from command line.

The output shows something related to the LogManager.. am i missing something?

thank you in advance,

$ java -jar wordinator.jar -i html/sample_web_page.html -o out -x xsl/html2docx/html2docx.xsl -t docx/Test_Template.dotx
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
+ 2019-12-02 18:37:23,047 [INFO ] Input document or directory='html/sample_web_page.html'
+ 2019-12-02 18:37:23,049 [INFO ] Output directory           ='out'
+ 2019-12-02 18:37:23,049 [INFO ] DOTX template              ='docx/Test_Template.dotx'
+ 2019-12-02 18:37:23,050 [INFO ] XSLT template              ='xsl/html2docx/html2docx.xsl'
+ 2019-12-02 18:37:23,050 [INFO ] Chunk level                ='root'
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.wordinator.xml2docx.MakeDocx.transformXml(MakeDocx.java:212)
	at org.wordinator.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:168)
	at org.wordinator.xml2docx.MakeDocx.main(MakeDocx.java:69)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
	at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:555)
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:580)
	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:567)
	at org.wordinator.xml2docx.generator.DocxGeneratingOutputUriResolver.<clinit>(DocxGeneratingOutputUriResolver.java:27)
	... 3 more

Table rows have lots of space above and below

I'm not sure this is a Wordinator issue, maybe it can be somehow fixed with a different template. But in case it's worth a check.

I'm attaching a docx file generated from the swpx attached to issue (2).

The TOC on page 1 is generated as a table. Note how far apart the text in rows is. Have no idea how to make the rows less high.

If you check the table on page 30, it's even worse. It has three rows ("ILLUSTRATIVE EXAMPLES", "APPENDIX", "Amendments to the guidance on other IFRSs") which are far apart.

Any suggestion as how this may be fixed is welcomed (either in swpx or in dotx).
bv-ifrs13.docx

Support Java 9+

Lastest POI versions support Java 9+. Wordinator should too.

Implement own exception type for reporting errors?

At the moment errors are reported to the user like this:

+ 2023-01-27 11:59:54,997 [ERROR] RuntimeException: RuntimeException: -x (transform) parameter not specified. If the input is a _Book.xml file, you must specify the -x parameter

It's not really great that user errors are presented as log messages instead of going to stderr and being clearly labeled as user-friendly error messages the user needs to deal with. The RuntimeException: RuntimeException: is also not great.

A good mechanism for letting the detail Java code report errors up to the MakeDocx CLI driver would be to define a WordinatorException for wordinator errors, and throw that in cases like the error above. MakeDocx would then be able to report these nicely to the user, and also to correctly stop processing (with shell error codes etc).

If this sounds like a good idea I'll be happy to make a PR and start converting at least some of the code to this method.

Example swpx files not applying styles correctly.

What I did:

java.exe -jar ../Tools/wordinator_1.0.3/wordinator.jar -i wordinator_1.0.3\src\test\resources\simplewp\simplewpml-test-02.swpx -o out -t wordinator_1.0.3\docx\Test_Template.dotx

What I expected to happen:

  • docx created with styles from Test_Template.dotx

What actually happened:

  • All heading styles seem to be ignored and just display in standard font within the docx (for example Heading 2 below).

image

I am using wordinator 1.0.3.

Unfortunately this makes the swpx format unusable for me because I can't use styles from the dotx file.

Comments

Hello, Eliot:

Our customer has prioritized another functionality that I would like to consult you on: comments. I saw in the release notes that this is something that was targeted for a future release but I don't know if it was completed. Are comments something that was completed or that is being worked on? Thank you very much ...

John

Nested tables appear in the schema not to be allowed

Reviewing the schema, it seems that tables are allowed only in body content and footnote content.

Body content is allowed only in headers, footers, and the body.

It seems that tables are not allowed in table cells, but such is needed a lot in my data as I have nested tables all over the place. (Maybe I can mitigate many of them, but I don't think all)

Since the recommendation is to validate SWPX before processing it, I've built that into my workflow and so I am stuck.

Provide proportional scaling of images

When an image has only one dimension specified explicitly the intrinsic size of the image is used for the other dimension. This can lead to strange results.

When only one dimension is specified explicitly, processor should scale the image proportionately.

Should probably provide the option to turn this behavior off.

cell background colour not displaying correctly

What I did:
Created test.html:

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
  <body>
    <table border="1">
      <tbody>
        <tr>
          <td bgcolor="red"><p>text</p></td>
        </tr>
      </tbody>
    </table>
  </body>
</html>

Run
java.exe -jar wordinator_1.0.3/wordinator.jar -i test.html -o out -x wordinator_1.0.3/html2docx/html2docx.xsl -t wordinator_1.0.3\src\test\resources\docx\Test_Template.dotx
Open html and docx files

What I expected to happen:
HTML shows 'text' in a red box
docx shows 'text' in a red box

What actually happened:
HTML shows 'text' in a red box
docx shows 'text' in a white box

image

Table option "Automatically resize to fit contents" should be disabled by default.

Alternatively, there should be an option to disable it. Without it the column widths are ignored in some cases, especially in east Asian languages which tend to have long strings without spaces. I'm attaching a sample swpx and Word files where this is apparent. Search for "The following warnings and precautions apply to:". You'll see column widths are 1.0 and 1.67 respectively. But this is ignored due to the content of the cell in the second column with "P305+P351 +P338" in the first column.

Landscape pages needed

Some tables are landscape tables. For those tables I'd need to be able to define a landscape page. I suppose this could be a section property, but I'm not sure. What would be the simplest way to implement this?

XSLT from HTML to SWPX for list paragraphs with bullet or numbers

Hi Eliot,
refered to fixed Issue 15, do you also have the XSL Transformation from HTML to SWPX for list paragraphs with bullets and numbers?

I saw the code of your example in html2docx/get-style-name.xls, but couldn't adapt it working for bullets and numbers.

Thanks in advance,
Steffi

Compiled .jar missing from 1.0.4 release

1.0.3 includes a zipped jar file which can be used without requiring a java compiler.
1.0.4 ommits this

Please could 1.0.4 (or above) include a compiled .jar file?

Failure on empty colwidth value

Re "Unexpected StringIndexOutOfBoundsException: String index out of range: -2", I've found out what it is. It's due to . I've fixed it by not generating colwidth if not specified. I do get the following warning in this case:

[WARN ] Widths of spanned columns are neither all percents or all measurements, cannot calculate exact spanned width
[WARN ] Widths are "auto", "auto", "auto", "auto", "auto"

It generates the table fine, but you may still want to check and eventually remove the warning in this case.

Bug in table cell property values

A causes a crash with the following error:

[java] java.lang.IllegalArgumentException: No enum constant org.apache.poi.xwpf.usermodel.ParagraphAlignment.JUSTIFY
[java]     at java.lang.Enum.valueOf(Enum.java:238)
[java]     at org.apache.poi.xwpf.usermodel.ParagraphAlignment.valueOf(ParagraphAlignment.java:29)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.makeTableRow(DocxGenerator.java:2045)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.makeTable(DocxGenerator.java:1552)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.handleBody(DocxGenerator.java:372)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.handleSection(DocxGenerator.java:416)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.handleBody(DocxGenerator.java:369)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.constructDoc(DocxGenerator.java:339)
[java]     at org.wordinator.xml2docx.generator.DocxGenerator.generate(DocxGenerator.java:312)
[java]     at org.wordinator.xml2docx.MakeDocx.handleSingleSwpxDoc(MakeDocx.java:272)
[java]     at org.wordinator.xml2docx.MakeDocx.handleDirectory(MakeDocx.java:294)
[java]     at org.wordinator.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:163)
[java]     at org.wordinator.xml2docx.MakeDocx.main(MakeDocx.java:69)
[java] + 2019-08-21 14:39:02,053 [ERROR] Unexpected IllegalArgumentException: No enum constant org.apache.poi.xwpf.usermodel.ParagraphAlignment.JUSTIFY

According to the rng "justify" is a valid value for align attribute on a . There must be a constants mismatch of some kind.

The swpx snippet that causes the crash is like this:

  <td colspan="3" align="justify" borderstylebottom="single" borderstyleright="single">
       <p style="IASB Table Arial" styleId="IASBTableArial">
            <run italic="true">(To recognise the foreign exchange gain on the bond, the adjustment to its carrying amount measured at fair value in LC and the movement in the accumulated impairment amount due to changes in foreign exchange rates)</run>
       </p>
  </td>

Page breaks don't work

I've come across a few issues related to page breaks. It looks like page breaks are not implemented at all although I can see them available in rng file.

I've tried the following.

<section type="nextPage"> (I've also tried type="oddPage", just to test).
<p ... page-break-before="true">.
<p ...><break type="page"/>... .

Neither works and the last is not allowed at all as Wordinator doesn't accept a inside a

even though it's allowed in the rng.

I'm attaching an swpx file with lots of sections with page breaks.
bv-ifrs13.zip

Index out of bounds exception

My SWPX file passes the schema, yet I get the following:

     [java] java.lang.StringIndexOutOfBoundsException: begin 0, end -2, length 0
     [java] 	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
     [java] 	at java.base/java.lang.String.substring(String.java:1874)
     [java] 	at org.wordinator.xml2docx.generator.Measurement.toInches(Measurement.java:63)
     [java] 	at org.wordinator.xml2docx.generator.Measurement.toPixels(Measurement.java:27)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.makeImage(DocxGenerator.java:1961)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.makeParagraph(DocxGenerator.java:1313)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.makeParagraph(DocxGenerator.java:1208)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.handleBody(DocxGenerator.java:478)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.constructDoc(DocxGenerator.java:435)
     [java] 	at org.wordinator.xml2docx.generator.DocxGenerator.generate(DocxGenerator.java:417)
     [java] 	at org.wordinator.xml2docx.MakeDocx.handleSingleSwpxDoc(MakeDocx.java:331)
     [java] 	at org.wordinator.xml2docx.MakeDocx.handleDirectory(MakeDocx.java:353)
     [java] 	at org.wordinator.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:199)
     [java] 	at org.wordinator.xml2docx.MakeDocx.main(MakeDocx.java:86)

File sent separately by email. Reproducible this time!!

Left margin on a table is needed

It's currently not possible to specify a left margin on a table. If you check a table in paragraph B27 (as attached to issue (4)), you'll see it's left aligned. It should be aligned with the body of the paragraph but there doesn't seem to be a way to achieve this at the moment.

Numbering definitions not copied to DOCX

Given a template that defines paragraph styles that use numbering (i.e., bulleted and numbered list items), the numbering definition from the DOTX file is not included in the generated DOCX file.

Symptom is that paragraphs that should have bullets or numbers to do not.

Unable to modify image size in output DOCX

When testing an input HTML containing an image, we are able to produce a DOCX file however the image size constraints are not observed and a large image displays.

Example:
<img src="./images/logo.jpg" width="200" height="120"/>

In the resulting DOCX I would expect to see the logo.jpg file constrained to the size restrictions detailed, h=200px, h=120px, however this is not the case. If you open the HTML file in a browser, you can see that the image dimensions are applied correctly.

Full HTML Example below:

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <style>
        body {
            font-family: arial;
        }
    </style>
</head>
<body>
<p style="width:300px;float:right">
    <img src="./images/logo.jpg" width="200" height="120"/>
</p>
<br/><br/><br/><br/>
<div style="width:1000px;float:left">
    <h1>Test Document - 2022 Edition</h1>
</div>
<br/><br/>
<table border="1" style="width:60%">
    <tbody>
    <tr>
        <td style="width:30%; background: #D3D3D3"><b>Summary</b></td>
        <td style="width:70%">This is a test to display the structure</td>
    </tr>
    </tbody>
</table>
<br/>
<table border="1" style="width:60%">
    <tbody>
    <tr>
        <td bgcolor="#D3D3D3" style="width:30%"><b>Document ID No:</b></td>
        <td style="width:70%">1234</td>
    </tr>
    <tr>
        <td bgcolor="#D3D3D3"><b>Issue Date:</b></td>
        <td style="width:70%">10/06/2022</td>
    </tr>
    </tbody>
</table>
<br/><br/><br/>
<h3>Table of Contents</h3>
<hr/>
<br/>
<p>1.1 - Level 1 - Page 4</p>
<br/>
<p>1.2 - Level 2 - Page 5</p>
<br/><br/>
<hr/>
<br/><br/>
<h2>2.1 - Level 1 - Example A</h2>
<p>This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
</p>
<br/><br/><br/>
<h3>2.1.1 2.1.2 - Level 2 - Example A1 Level 2 - Example A2</h3>
<p>This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
</p>
<br/><br/>
<hr/>
<h2>2.2 - Level 1 - Example B</h2>
<p>This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
</p>
<br/><br/><br/>
<h3>2.2.1 2.2.2 - Level 2 - Example B1 Level 2 - Example B2</h3>
<p>This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. This is some dummy text to take up space. 
</p>
<br/><br/>
<hr/>
<br/><br/><br/><br/><br/>
<table border="1">
    <tbody>
    <tr bgcolor="#D3D3D3">
        <th>Name</th>
        <th>ID</th>
    </tr>
    <tr>
        <td>Level 2 - Example A1</td>
        <td>3544</td>
    </tr>
    <tr>
        <td>Level 2 - Example A2</td>
        <td>8745</td>
    </tr>
    <tr>
        <td>Level 2 - Example B1</td>
        <td>2486</td>
    </tr>
    <tr>
        <td>Level 2 - Example B2</td>
        <td>9745</td>
    </tr>
    </tbody>
</table>
<br/>
</body>
</html>

Add MathML support

We need MathML support in Wordinator, and are willing to implement it, and make a PR.

If we do we'll add it to the SWPX schema, and use Microsoft's MML2OMML.xsl to transform the MathML into Office math format. We'll then use the POI API to load the transformed XML into org.openxmlformats.schemas.wordprocessingml.x2006.main objects, and then put those into the XWPFDocument.

There may be issues with redistributing the stylesheet as part of Wordinator, so we may need a workaround for that.

Would a PR adding this feature be welcome? Are there any particular issues you'd be concerned about? I'm asking about this before we start to avoid complications down the road.

Can't set styles of table entries

I'm trying to set a style of a table header and table row.
The table style and paragraph style for the table text are both defined in my dotx.

But whatever html I write, I cannot get wordinator to apply a table style from my dotx into the generated docx.

HTML in:

      <table>
        <tbody>
          <tr class="trstyle1">
            <!-- start table row -->
            <th>Heading A</th>
            <th>Heading B </th>
            <th>Heading C </th>
          </tr>
          <tr>
            <!-- start another row -->
            <td>Cell 1A </td>
            <td>Cell 1B </td>
            <td>Cell 1C </td>
          </tr>
          <tr>
            <!-- start another row -->
            <td class="right">Cell 2A </td>
            <td>Cell 2B </td>
            <td>Cell 2C </td>
          </tr>
          <tr>
            <!-- start another row -->
            <td>Cell 3A </td>
            <td>Cell 3B </td>
            <td>Cell 3C </td>
          </tr>
        </tbody>
      </table>

get-style-name.xsl:

  <xsl:variable name="classToStyleNameMap" as="map(xs:string, xs:string)">
    <xsl:map>
      <xsl:map-entry key="'trstyle1'" select="'Table Text'"/>
    </xsl:map>
  </xsl:variable>

Every time I just get a plain table with no styles applied to any of the cells or text.

image

Am I missing something? Maybe someone could share an example where this works? I am using 1.03 and I see that table styles were added at 1.0, but I can't get them to work at all.

Table sizings are not adhered to following implementation of #70

When testing the change made for #70 , images are now successfully constrained to the detailed size however I've noticed that tables now seem to be suffering from a lack of proportions following the implementation of this change.

It can be seen in the image-geometry-test files that you uploaded whereby each column of the table has one character per line. Tables in this file are specified using % widths, is there perhaps a conflict between using px values for images and % values for tables now?

image-geometry-test.docx (1).zip

Enable setting table cell border color

The OOXML markup allows @color to be set on each border of table cell. The SimpleWP markup and DOCX generation should support that.

Need to document (or refer to) the Word border conflict resolution rules and possibly provide a way to set the strategy of OOXML provides options.

Last section creates unwanted trailing blank page

The last section in a multi-section document results in an extra blank page.

The solution is to put the section definition for the last section directly within the body, not within the last paragraph of the section.

Generate working ToC, not just ToC field

It should be possible to generate the ToC entries so that on open Word prompts to update the ToC.

Jarno's OOXML plug-in for Open Toolkit generates all the ToC entries and when you open it Word prompts you to update the page numbers or the full ToC.

Explicitly-Specified Footnote Callouts

Provide the ability to specify, for an individual footnote, the callout to use for the referencer in the source and, optionally, the reference in the footnote list (by default they would be the same but Word allows them to be different).

Word does not provide a way to have separate numbering streams for footnotes of a given type (i.e., bottom-of-page footnotes where different notes reflect different numbering streams).

In addition, there is sometimes a need to have a footnote that is not numbered, i.e., a "*" footnote used along with numbered footnotes (although in that case usually any numbered footnotes are end notes but it's not a requirement).

Thus, there needs to be a way to give footnotes arbitrary callouts.

In the Word markup, the solution is:

  • Set the callout text in both the footnoteReference (in content) and footnoteRef (in footnote)
  • Set the @customMarkFollows attribute on the footnoteReference and generate the mark (<w:t>) after the footnoteRef element
  • Remove the footnoteref element from the footnote.
  • Set the mark text in the footnote, by default using the in-content callout.

This will require constructing the OOXML directly as the WPXFFootnote element does not provide for custom marks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.