[docx] Fix position error in libre/only office

This commit is contained in:
Fernando 2023-05-15 11:48:22 -05:00
parent 4448539307
commit 4437a6856f
2 changed files with 4 additions and 53 deletions

View File

@ -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;",
}); });

View File

@ -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({