aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PDFBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-06-26 16:41:01 -0400
committerbobzel <zzzman@gmail.com>2025-06-26 16:41:01 -0400
commit2d70a3bc17fe94d0bf92d8362b8fda8a2e4a82e1 (patch)
treea9b733e4318f18890459a10ad50d393abf76f6e1 /src/client/views/nodes/PDFBox.tsx
parent0093370a04348ef38b91252d02ab850f25d753b2 (diff)
fixed rendering pdfs, text selections on pdfs,
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r--src/client/views/nodes/PDFBox.tsx15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 5501f0a31..4deb1f207 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -72,12 +72,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
!this.Document._layout_fitWidth && (this.Document._height = NumCast(this.Document._width) * (nh / nw));
if (this.pdfUrl) {
this._pdf = PDFBox.pdfcache.get(this.pdfUrl.url.href);
- !this._pdf &&
- PDFBox.pdfpromise.get(this.pdfUrl.url.href)?.then(
- action(pdf => {
- this._pdf = pdf;
- })
- );
+ !this._pdf && PDFBox.pdfpromise.get(this.pdfUrl.url.href)?.then(action(pdf => (this._pdf = pdf)));
}
}
@@ -150,8 +145,8 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
this.addDocument(region);
const newDiv = docViewContent.cloneNode(true) as HTMLDivElement;
- newDiv.style.width = NumCast(this.layoutDoc._width).toString();
- newDiv.style.height = NumCast(this.layoutDoc._height).toString();
+ newDiv.style.width = NumCast(this.layoutDoc._width).toString() + 'px';
+ newDiv.style.height = NumCast(this.layoutDoc._height).toString() + 'px';
this.replaceCanvases(docViewContent, newDiv);
const htmlString = this._pdfViewer?._mainCont.current && new XMLSerializer().serializeToString(newDiv);
@@ -409,7 +404,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
this.layoutDoc._show_sidebar = nativeWidth !== this.layoutDoc._nativeWidth;
}
});
- settingsPanel() {
+ @computed get settingsPanel() {
const pageBtns = (
<>
<button type="button" className="pdfBox-backBtn" key="back" title="Page Back" onPointerDown={e => e.stopPropagation()} onClick={this.backPage}>
@@ -675,7 +670,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
<div className="pdfBox-sidebarContainer" style={{ width: `calc(100 * ${this.sidebarWidth() / this._props.PanelWidth()}%` }}>
{this.sidebarCollection}
</div>
- {this.settingsPanel()}
+ {this.settingsPanel}
</div>
);
}