gyselroth / docxbox Goto Github PK
View Code? Open in Web Editor NEWCLI tool for Word DOCX templating and analysis
License: MIT License
CLI tool for Word DOCX templating and analysis
License: MIT License
Describe the bug
Replacing text by a table renders a table without table-header.
Describe the bug
Trying to replace a merge field which is located either in the footer or the header with a string doesn't work. No error message is given.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The provided field is replaced by the given string
Environment:
ccpcheck reports:
[src/docxbox/helper/helper_image.cc:9]: (style) The function 'GetDimension' is never used.
[src/docxbox/helper/helper_string.cc:102]: (style) The function 'GetSubStrAfter' is never used.
[src/docxbox/helper/helper_string.cc:28]: (style) The function 'GetSubStrCount' is never used.
[src/vendor/tinyxml2/tinyxml2.cpp:1979]: (style) The function 'InsertNewChildElement' is never used.
[src/vendor/tinyxml2/tinyxml2.cpp:1985]: (style) The function 'InsertNewComment' is never used.
[src/vendor/tinyxml2/tinyxml2.cpp:1997]: (style) The function 'InsertNewDeclaration' is never used.
[src/vendor/tinyxml2/tinyxml2.cpp:1991]: (style) The function 'InsertNewText' is never used.
[src/vendor/tinyxml2/tinyxml2.cpp:2003]: (style) The function 'InsertNewUnknown' is never used.
[src/docxbox/helper/helper_file.cc:6]: (style) The function 'IsFile' is never used.
[src/docxbox/helper/helper_string.cc:123]: (style) The function 'IsNumeric' is never used.
[src/docxbox/helper/helper_string.cc:60]: (style) The function 'ReplaceAll' is never used.
[src/docxbox/helper/helper_string.cc:38]: (style) The function 'ReplaceFirstOccurrence' is never used.
[src/docxbox/helper/helper_string.cc:155]: (style) The function 'ToLower' is never used.
[src/docxbox/helper/helper_string.cc:163]: (style) The function 'ToUpper' is never used.
[src/docxbox/helper/helper_string.cc:168]: (style) The function 'UcFirst' is never used.
Describe the bug
Trying to change the meta attribute "subject" throws an error:
"terminate called after throwing an instance of 'char const*'"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Meta attribute gets changed
Environment:
Describe the bug
Setting the meta attribute "created" resets "modified" and vice versa
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Given meta attribute gets changed without changing the other attribute
Environment:
TODO(kay): fix possible crash during rpt:
docxbox rpt foo.docx "22.02.2016" "11.01.2020"
=> terminate called after throwing an instance of 'std::bad_alloc'
Describe the missing feature
test.sh does not return any conclusive status code: its return code always signals successful execution, independent of the results of the individual test suites.
TODO
When any single one (or more) of the invoked test suites does return a code different to 0 (= success), test.sh should finally conclude with a return signal 1 (= general error).
Describe the bug
When running
"./docxbox lsl filename.docx {missing search string}"
or
"./docxbox lsl {missing filename}"
an error is thrown:
terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
To Reproduce
Steps to reproduce the behavior:
OR
Expected behavior
An error message stating that a required argument is missing respectively
An error message stating that a required file is missing
Environment:
Describe the bug
Setting field values in headers or footers is not yet supported.
Describe the bug
The command to list fields in a docx is: ./docxbox lsd filename.docx, but the output of "./docxbox h " is: {see screenshot} lsg <--> lsd
To Reproduce
Steps to reproduce the behavior:
Expected behavior
correct output of commands
Environment:
Describe the bug
When running
"./docxbox lsl filename.docx -j searchString"
or
"./docxbox lsl filename.docx --json searchString"
an error is thrown:
terminate called after throwing an instance of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
To Reproduce
Steps to reproduce the behavior:
Expected behavior
List of files containing given search string as JSON
Environment:
Describe the bug
Replacing a string with a table makes DOCX invalid
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Environment:
Additional information
Screenshot only shows relevant lines, the actual diff has more lines
Describe the bug
Setting filed values by using "sfv" breaks and throws an error:
terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_M_construct null not valid
.
A directory with the unziped files is created in the project root
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Setting new value to given field.
Environment:
Describe the bug
ATM the width of generic tables and their columns cannot be specified.
A solution for this issue probably needs some thought / discussion before implementation.
Describe the bug
When trying to replace text in a file by dummy text and saving it to a new file, the old file is replaced by the new one.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Text gets replaced and is saved in new file
Environment:
The rpi command doesn't replace images, no error is given
Describe the bug
Setting or changing meta attributes throw errors:
description:
docxBox Error - iled render opening tag. Unknown attribute:
docxBox Error - iled render opening tag. Unknown attribute:
docxBox Error - iled render closing tag. Unknown attribute:
docxBox Error - Update/Insert meta attribute failed.
Application, AppVersion, Company, xmlSchema, Template:
docxBox Error - Invalid argument: Unknown or unsupported attribute: {Meta-Attribute}
docxBox Error - Initialization for meta modification failed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Provided Meta-Attribute is set/changed
Environment:
Feature
Wildcards processed by ls command should support all globbing patterns.
Describe the bug
When running the longhand command of lslj (--lj) all files are listed (not just those containing given search string) and are not in JSON-Format
To Reproduce
Expected behavior
A list of files containing given search string as JSON
Environment:
Describe the bug
Trying to set a meta attribute through batch processing throws an error:
docxBox Error - Invalid argument: Unknown or unsupported attribute: "title"
docxBox Error - Initialization for meta modification failed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Meta attribute gets set, batch processing continues
Environment:
Describe the bug
When listing fields with the "lsd" command fields in the footer are not listed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Command lists all fields in docx
Environment:
Describe the bug
When trying to randomize text in a docx file by running "docxbox lorem .docx" an error is thrown:
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Text in provided docx file gets replaced by random text
Environment:
Describe the bug
The "./docxbox h lslj" or any other "lslj" command don't work.
The Output is: "Unknown command: lslj."
To Reproduce
Expected behavior
Help displayed for lslj command
Environment:
Describe the feature
Ensure functionality of logging to file
Describe the bug
When trying to list files in a none .docx file docxbox throws an error:
terminate called after throwing an instance of 'std::runtime_error'
what(): bad zip
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An error message stating a wrong file type was provided.
Environment:
Describe the bug
Batch processing still always overwrites the source DOCX, a given destination filename is ignored.
When modifying dates, ensure plausibility - e.g. print-date cannot be before creation-date
Describe the bug
When running the "rem" command more than the expected strings are removed.
To Reproduce
Expected behavior
All strings in between and including given strings are removed from given .docx
Environment:
Describe the bug
replace text using markup text, then the docx file can not be open by word2016
To Reproduce
Steps to reproduce the behavior:
Environment:
Describe the bug
When trying to replace a given string by a heading docxBox throws an error:
docxBox Error - DOCX creation failed
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The given string gets replaced by the given heading
Environment:
Feature
Currently, there's no functional test that checks listing and modifying fields contained in header or footer sections.
Describe the bug
When using the longhand option of the uzi command (uz -i or uz --indent) the XML files are not indented.
Additionally, there is a spelling error when displaying help (ident instead of indent)
To Reproduce
Expected behavior
XML files get indented
Environment:
Describe the bug
Trying to replace an image omitting the image- name and path to be replaced, a folder containing the files of the given .docx named like the .docx file is created in the project root.
An error message is given, stating a file name of the replacement image is missing.
To Reproduce
Command:
Files:
Expected behavior
An error message.
Environment:
Describe the bug
When trying to replace a string by another string, it doesn't get replaced and the process isn't terminated. No error is shown.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All occurrences of given string are replaced
Environment:
Describe the bug
The error message of the rpi command without providing a docx file is misleading.
Error message now: "Missing argument: Filename of image to be replaced"
Expected Error message: "Missing argument: Filename of DOCX to be extracted"
To Reproduce
Expected behavior
An error message stating the docx file is missing. The correct message was provided, but possibly got lost.
Environment:
both dates are set automatically to current ISO 8601 date-time.
Describe the bug
rpt w/ ordered-list renders an unordered list instead.
Additional information
Speculation: abstractNumId of numbering.xml and document.xml might point to the wrong markup.
TODO(kay): optional out-filename not recognized during cmd command:
docxbox cmd foo.docx "nano DOCX/word/document.xml" foo2.docx
=> Hit [Enter] when done.
mv: missing destination file operand after 'tmp.zip'
Try 'mv --help' for more information.
Please see issues within the ShellCheck report of functional tests.
Technical Debt
ATM zipping extracted files into a DOCX invokes (and requires having installed) the zip application instead of using MinizCpp (as the unzip operations do). The existing method for zipping via MinizCpp creates a DOCX which MS Word notifies as being corrupt (other word processors accept it).
Meta attributes can only be changed, not set.
Describe the bug
When trying to replace an image in a docx an error is thrown:
File not found: cp_table_unordered_list_images.docx-1589441700/word/media/image1.jpeg
The doesn't get replaced.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The image gets replaced
Environment:
For consistency of naming (existing and future) commands, "rem" command should be named "rmt".
The naming will than correspond to "replace text" being abbreviated "rpt", and will keep sibling commands consistent and deductable and easier rememberable (e.g. "remove between fields": "rmf").
Feature
Instead of expecting EMUs, image dimension should be accepted in pixels and converted into EMUs by docxBox.
Missing Feature
Batch sequencing does not add given images
Describe the bug
Replacing text with an image throws an error when using EMU's:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The provided text gets replaced by the given image
Environment:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.