Issue with Changing Freehand Drawing Stroke Width (Default 3pt vs. Desired 2pt) in Adobe PDF Embed A
Hi everyone,
I'm experiencing an issue with the Adobe PDF Embed API regarding the freehand drawing (shape annotation) stroke width. In our React application, we want the freehand drawing tool to render with a line thickness of 2pt instead of the default 3pt.
According to the documentation, we should be able to set the stroke width by passing the strokeWidth property to the startAnnotationMode API, like this:
annotationManager.startAnnotationMode("shape", {
defaultColor: "#0a23f5",
cursor: "crosshair",
strokeWidth: 2, // Expected to set the line thickness to 2pt
});
We’ve tried several approaches:
Direct Call After previewFile:
Immediately after calling previewFile, we obtain the annotation manager and call startAnnotationMode with strokeWidth: 2. However, the freehand drawing still uses a 3pt stroke.Monkey-Patching/Overriding:
We attempted to override the startAnnotationMode method (both on the AdobeDC.View prototype and on the annotation manager instance) to force the strokeWidth to 2, but it remains unchanged.CSS Override:
As a last resort, we tried overriding the rendered SVG element’s stroke width using CSS, but it wasn’t reliable because Adobe’s SDK appears to apply inline styles that override our CSS rules.
Despite these efforts, the freehand drawing tool always renders with a 3pt stroke. Has anyone encountered this issue or know if there’s a limitation or bug in the current version of the API that prevents customizing the stroke width for freehand annotations?
Any advice or workaround would be greatly appreciated!
Thank you.
