feat(IAnnotation): Hinzufügen und Implementieren der Eigenschaften BackgroundColor, BorderColor, BorderStyle und BorderWidth.
- Hintergrund mit neuen Eigenschaften in Annotations.js binden
This commit is contained in:
@@ -5,21 +5,22 @@ async function createAnnotations(document, instance) {
|
||||
for(var element of document.elements) {
|
||||
const annotParams = await getAnnotationParams(element.left, element.top);
|
||||
const page = element.page - 1
|
||||
|
||||
|
||||
//background
|
||||
if(annotParams.background){
|
||||
let background = annotParams.background;
|
||||
const id_background = PSPDFKit.generateInstantId();
|
||||
const annotation_background = new PSPDFKit.Annotations.WidgetAnnotation({
|
||||
id: id_background,
|
||||
pageIndex: page,
|
||||
formFieldName: id_background,
|
||||
backgroundColor: new PSPDFKit.Color({ r: 222, g: 220, b: 215 }),
|
||||
backgroundColor: background?.backgroundColor ? new PSPDFKit.Color(background.backgroundColor) : null,
|
||||
blendMode: 'normal',
|
||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.background),
|
||||
boundingBox: new PSPDFKit.Geometry.Rect(background),
|
||||
fontSize: 8,
|
||||
borderStyle: 'underline',
|
||||
borderWidth: 4,
|
||||
borderColor: new PSPDFKit.Color({ r: 204, g: 202, b: 198 })
|
||||
borderStyle: background.borderStyle,
|
||||
borderWidth: background.borderWidth,
|
||||
borderColor: background?.borderColor ? new PSPDFKit.Color(background.borderColor) : null
|
||||
});
|
||||
|
||||
const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({
|
||||
|
||||
Reference in New Issue
Block a user