forked from unidoc/unioffice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document.SetConformance is added with an example (unidoc#399)
* document.SetConformance is added with an example * SetStrict is added as shortcut * 2020 * preserve conformance attr * fix
- Loading branch information
1 parent
cd8c690
commit 56b03a8
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2020 FoxyUtils ehf. All rights reserved. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/unidoc/unioffice/document" | ||
st "github.com/unidoc/unioffice/schema/soo/ofc/sharedTypes" | ||
) | ||
|
||
func main() { | ||
doc, err := document.Open("document.docx") | ||
if err != nil { | ||
panic(err) | ||
} | ||
doc.SetStrict(false) // document will be saved as Word document (this is a default option for new files) | ||
doc.SaveToFile("conformance_transitional.docx") | ||
doc.SetStrict(true) // document will be saved in the Strict mode | ||
doc.SaveToFile("conformance_strict.docx") | ||
doc.SetConformance(st.ST_ConformanceClassUnset) // Conformance attribute will be unset, which also leads to saving as Word document | ||
doc.SaveToFile("conformance_unset.docx") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
module github.com/unidoc/unioffice | ||
|
||
go 1.12 |