Add titlepg (#816)
* feat: add title_pg * chore: rc46 * fix: add title_pg * fix: add title pg * rc47 * rc48main
parent
4728e080a4
commit
077de5d561
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Support `dstrike`
|
- Support `dstrike`
|
||||||
- Update Add after for default toc styles #806
|
- Update Add after for default toc styles #806
|
||||||
- Update `Level` styles.
|
- Update `Level` styles.
|
||||||
|
- Support `titlePg`
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## @0.4.17 (26. Apr, 2024)
|
## @0.4.17 (26. Apr, 2024)
|
||||||
|
|
|
@ -140,6 +140,11 @@ impl Document {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn title_pg(mut self) -> Self {
|
||||||
|
self.section_property = self.section_property.title_pg();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn page_size(mut self, size: PageSize) -> Self {
|
pub fn page_size(mut self, size: PageSize) -> Self {
|
||||||
self.section_property = self.section_property.page_size(size);
|
self.section_property = self.section_property.page_size(size);
|
||||||
self
|
self
|
||||||
|
|
|
@ -457,6 +457,11 @@ impl Docx {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn title_pg(mut self) -> Self {
|
||||||
|
self.document = self.document.title_pg();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn page_size(mut self, w: u32, h: u32) -> Self {
|
pub fn page_size(mut self, w: u32, h: u32) -> Self {
|
||||||
self.document = self.document.page_size(PageSize::new().size(w, h));
|
self.document = self.document.page_size(PageSize::new().size(w, h));
|
||||||
self
|
self
|
||||||
|
|
|
@ -152,6 +152,11 @@ export class Docx {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
titlePg() {
|
||||||
|
this.sectionProperty.titlePg();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
pageSize(w: number, h: number) {
|
pageSize(w: number, h: number) {
|
||||||
this.sectionProperty.pageSize(w, h);
|
this.sectionProperty.pageSize(w, h);
|
||||||
return this;
|
return this;
|
||||||
|
@ -549,6 +554,10 @@ export class Docx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.sectionProperty._titlePg) {
|
||||||
|
docx = docx.title_pg();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.sectionProperty._pageTypeNum) {
|
if (this.sectionProperty._pageTypeNum) {
|
||||||
const { start, chapStyle } = this.sectionProperty._pageTypeNum;
|
const { start, chapStyle } = this.sectionProperty._pageTypeNum;
|
||||||
const p = wasm.createPageNumType(start, chapStyle);
|
const p = wasm.createPageNumType(start, chapStyle);
|
||||||
|
|
|
@ -14,6 +14,7 @@ export class SectionProperty {
|
||||||
w: 11906,
|
w: 11906,
|
||||||
h: 16838,
|
h: 16838,
|
||||||
};
|
};
|
||||||
|
_titlePg: boolean | null = null;
|
||||||
_pageMargin: PageMargin | null = null;
|
_pageMargin: PageMargin | null = null;
|
||||||
_docGrid: DocGrid | null = null;
|
_docGrid: DocGrid | null = null;
|
||||||
_header: Header | null = null;
|
_header: Header | null = null;
|
||||||
|
@ -24,6 +25,11 @@ export class SectionProperty {
|
||||||
_evenFooter: Footer | null = null;
|
_evenFooter: Footer | null = null;
|
||||||
_pageTypeNum: PageNumType | null = null;
|
_pageTypeNum: PageNumType | null = null;
|
||||||
|
|
||||||
|
titlePg() {
|
||||||
|
this._titlePg = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
pageSize(w: number, h: number) {
|
pageSize(w: number, h: number) {
|
||||||
this._pageSize.w = w;
|
this._pageSize.w = w;
|
||||||
this._pageSize.h = h;
|
this._pageSize.h = h;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.4.18-rc45",
|
"version": "0.4.18-rc48",
|
||||||
"main": "dist/node/index.js",
|
"main": "dist/node/index.js",
|
||||||
"browser": "dist/web/index.js",
|
"browser": "dist/web/index.js",
|
||||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||||
|
|
|
@ -123,6 +123,11 @@ impl Docx {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn title_pg(mut self) -> Docx {
|
||||||
|
self.0 = self.0.title_pg();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn page_size(mut self, w: u32, h: u32) -> Docx {
|
pub fn page_size(mut self, w: u32, h: u32) -> Docx {
|
||||||
self.0 = self.0.page_size(w, h);
|
self.0 = self.0.page_size(w, h);
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in New Issue