Compare commits

...

2 Commits

Author SHA1 Message Date
Jonathan Jenne
9245448d1c fix DatabaseService 2023-11-06 13:20:24 +01:00
Jonathan Jenne
a1bec774cd add validateAnnotations 2023-11-06 13:20:03 +01:00
2 changed files with 16 additions and 1 deletions

View File

@@ -217,6 +217,21 @@ class Annotation {
return await instance.delete(pageAnnotations);
}
public async validateAnnotations(instance: Instance): Promise<boolean> {
let pageAnnotations = (
await Promise.all(Array.from({ length: instance.totalPageCount }).map((_, pageIndex) =>
instance.getAnnotations(pageIndex)
))
).flatMap((annotations) =>
annotations.reduce((acc, annotation) => acc.concat(annotation), [])
).map((annotation: WidgetAnnotation) => {
console.log(annotation.toJS());
return annotation;
});
return true;
}
private createAnnotationFromElement(element: Element): [annotation: WidgetAnnotation, formField: SignatureFormFieldType] {
const id = PSPDFKit.generateInstantId()
const width = this.inchToPoint(element.width)

View File

@@ -28,7 +28,7 @@ namespace EnvelopeGenerator.Web.Services
}
public readonly ModelContainer? Models;
public DatabaseService(IConfiguration Config, LoggingService Logging, DatabaseService database) : base(Config, Logging)
public DatabaseService(IConfiguration Config, LoggingService Logging) : base(Config, Logging)
{
logger = Logging.LogConfig.GetLogger();