Skip to content

Commit 3f12417

Browse files
authored
Merge pull request #1456 from mfts/marc/pm-109-fix-watermark
fix: watermark on veritcal docs
2 parents 73cfb4d + 8ac8150 commit 3f12417

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

components/view/viewer/pages-vertical-viewer.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ export default function PagesVerticalViewer({
774774
? pages.map((page, index) => (
775775
<div
776776
key={index}
777-
className="w-full px-4 md:px-8"
777+
className="relative w-full px-4 md:px-8"
778778
style={{
779779
width: containerWidth
780780
? `${calculateOptimalWidth(containerWidth, page.metadata, isMobile, isTablet)}px`
@@ -805,24 +805,21 @@ export default function PagesVerticalViewer({
805805
alt={`Page ${index + 1}`}
806806
/>
807807

808-
{watermarkConfig ? (
809-
<SVGWatermark
810-
config={watermarkConfig}
811-
viewerData={{
812-
email: viewerEmail,
813-
date: new Date().toLocaleDateString(),
814-
time: new Date().toLocaleTimeString(),
815-
link: linkName,
816-
ipAddress: ipAddress,
817-
}}
818-
documentDimensions={
819-
imageDimensions[index] || {
820-
width: 0,
821-
height: 0,
822-
}
823-
}
824-
pageIndex={index}
825-
/>
808+
{watermarkConfig && imageDimensions[index] ? (
809+
<div className="absolute left-0 top-0">
810+
<SVGWatermark
811+
config={watermarkConfig}
812+
viewerData={{
813+
email: viewerEmail,
814+
date: new Date().toLocaleDateString(),
815+
time: new Date().toLocaleTimeString(),
816+
link: linkName,
817+
ipAddress: ipAddress,
818+
}}
819+
documentDimensions={imageDimensions[index]}
820+
pageIndex={index}
821+
/>
822+
</div>
826823
) : null}
827824

828825
{page.pageLinks ? (

0 commit comments

Comments
 (0)