I need to create a stamp to mark a signature area, I need to add an HTML element that shows me the x and y position, and the element can be dragged between pages, has anyone already implemented this solution?
I tried using the ngx-extended-pdf-viewer component, I couldn’t render HTML or get the position of the element
public async addTextEditorForPage(pageNumber: number): Promise<void> {
const pageSize = await this.getPageSize(pageNumber);
console.log(`Page ${pageNumber} - Orientation: ${pageSize.orientation}`);
const lines = await this.pdfService.getPageAsLines(pageNumber);
const firstLineHeight = lines.length > 0 ? lines[0].height : 0;
const rectWidth = pageSize.orientation === 'landscape' ? lines[lines.length - 1].width - 20 : firstLineHeight;
const textEditorAnnotation: FreeTextEditorAnnotation = {
annotationType: 3,
color: [0, 0, 0],
fontSize: 13,
value: `ABCABCABC TEST`,
pageIndex: pageNumber - 1, // Índices de página começam do 0
rect: [
100, // espaço entre a borda da esquerda e o texto
0,
0,
rectWidth,
],
rotation: 0,
};
this.addedAnnotations.push(textEditorAnnotation);
this.pdfService.addEditorAnnotation(textEditorAnnotation);
}