HI
Are you loading the saved pdf after the page is refreshed? If not, is the saved PDF related to page refreshing?
Yes after saving pdf and refreshing the page link doesnt work either in pdf or on PDFTron viewer.
Could you clarify what you mean by the URL attach to it? Could you show us the code and how your custom annotation is supposed to look like?
We are adding links to annotation programmatically in our custom annotation and works fine when save before reloading page. Below is the code snippet we are using to create a custom annotation.
onClick: function (originalEvent, element, docViewer, annotations, fileInfo) {
if (!element.dataset.wpcode.length) return;
var annotManager = docViewer.getAnnotationManager();
var stampAnnot = new annotations.StampAnnotation();
var svgWidth = element.querySelector(’#wpReferenceLabel’).clientWidth / 3;
var pdfCoords = pdfUtils.calculateDropInCoordinatesByCustomLeftPanelClick(originalEvent, docViewer, {width: svgWidth, height: 55});
var dropIn = pdfCoords.y * docViewer.getZoom();
var stamp = pdfUtils.initCustomStamp(
annotManager.getCurrentUser(),
docViewer.getCurrentPage(),
svgWidth,
55,
“wpReference”,
{ uri: element.dataset.wplink, ref: element.dataset.wpref, code: element.dataset.wpcode, ypos: dropIn, xpos: pdfCoords.x },
stampAnnot
);
if (pdfUtils.isEdge()) {
pdfUtils.getCreateStampImageData(‘wp’, element.dataset.wpcode, svgWidth, [], function(img) {
var imagedata = ‘data:image/png;base64,’ + decodeURIComponent(img.imagedata);
pdfUtils.redrawLeftPanelStampImage(imagedata, img.size.width, img.size.height, dropIn, stamp, annotManager);
});
} else {
var svgContent = pdfUtils.createSVGForLeftPanelStamp(‘wp’, svgWidth, 55, fileInfo, element);
setTimeout(pdfUtils.convertSVG2PNG64(‘workpaperStampCanvas’, ‘data:image/svg+xml;utf-8,’ + svgContent, 100, 55, function (s) {
pdfUtils.redrawLeftPanelStampImage(s, pdfCoords, dropIn, stamp, annotManager);
}), 0);
}
}
What approach we can use to make it work when it becomes part of PDF?