aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-08-30 10:23:13 -0400
committerbobzel <zzzman@gmail.com>2021-08-30 10:23:13 -0400
commit962a1a3f1ae9a55c5aea630d3252cecb740fa15c (patch)
tree9f5f234786af112a475ea5be962e2e2907fb2dfe /src/client/documents/Documents.ts
parent584926578067f023b52c7754e65bc289f2a745e6 (diff)
parent2d2e027f11253834a337680bbfd1ac549bb2a1f0 (diff)
merged with master - fixed warnings and errors.
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 007262f9c..ec856e748 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -729,10 +729,20 @@ export namespace Docs {
}
export function PdfDocument(url: string, options: DocumentOptions = {}) {
+ const width = options._width || undefined;
+ const height = options._height || undefined;
+ const nwid = options._nativeWidth || undefined;
+ const nhght = options._nativeHeight || undefined;
+ if (!nhght && width && height && nwid) options._nativeHeight = Number(nwid) * Number(height) / Number(width);
return InstanceFromProto(Prototypes.get(DocumentType.PDF), new PdfField(url), options);
}
export function WebDocument(url: string, options: DocumentOptions = {}) {
+ const width = options._width || undefined;
+ const height = options._height || undefined;
+ const nwid = options._nativeWidth || undefined;
+ const nhght = options._nativeHeight || undefined;
+ if (!nhght && width && height && nwid) options._nativeHeight = Number(nwid) * Number(height) / Number(width);
return InstanceFromProto(Prototypes.get(DocumentType.WEB), url ? new WebField(url) : undefined, options);
}