[docx] Fix position error in libre/only office
This commit is contained in:
parent
4448539307
commit
4437a6856f
33
docx/main.ts
33
docx/main.ts
@ -8,6 +8,7 @@ import {
|
|||||||
VerticalPositionAlign,
|
VerticalPositionAlign,
|
||||||
TextRun,
|
TextRun,
|
||||||
AlignmentType,
|
AlignmentType,
|
||||||
|
ShadingType,
|
||||||
} from "docx";
|
} from "docx";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import * as QR from "qrcode";
|
import * as QR from "qrcode";
|
||||||
@ -277,10 +278,6 @@ const certificateName = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -305,10 +302,6 @@ const certificatePersonName = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -336,10 +329,6 @@ const certificateExpedite = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -364,10 +353,6 @@ const certificateCode = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -392,10 +377,6 @@ const certificateBody = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -442,10 +423,6 @@ const certificateFinishLabel = new Paragraph({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -455,6 +432,7 @@ const certificateFinishLabel = new Paragraph({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
alignment: AlignmentType.CENTER,
|
alignment: AlignmentType.CENTER,
|
||||||
|
style: "highlighting: none;",
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fecha de Emision: ...
|
// Fecha de Emision: ...
|
||||||
@ -468,11 +446,7 @@ const certificateDate = new Paragraph({
|
|||||||
height: cmText(1.4),
|
height: cmText(1.4),
|
||||||
anchor: {
|
anchor: {
|
||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.TEXT,
|
||||||
},
|
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
@ -490,6 +464,7 @@ const certificateDate = new Paragraph({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
alignment: AlignmentType.LEFT,
|
alignment: AlignmentType.LEFT,
|
||||||
|
style: "highlighting: none;",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,10 +160,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -188,10 +184,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -219,10 +211,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -275,10 +263,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -325,10 +309,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
@ -353,10 +333,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
alignment: {
|
|
||||||
x: HorizontalPositionAlign.CENTER,
|
|
||||||
y: VerticalPositionAlign.TOP,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
new TextRun({
|
new TextRun({
|
||||||
|
Loading…
Reference in New Issue
Block a user