diff options
author | bobzel <zzzman@gmail.com> | 2021-08-30 10:23:13 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-30 10:23:13 -0400 |
commit | 962a1a3f1ae9a55c5aea630d3252cecb740fa15c (patch) | |
tree | 9f5f234786af112a475ea5be962e2e2907fb2dfe /src/client/documents/Documents.ts | |
parent | 584926578067f023b52c7754e65bc289f2a745e6 (diff) | |
parent | 2d2e027f11253834a337680bbfd1ac549bb2a1f0 (diff) |
merged with master - fixed warnings and errors.
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 10 |
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); } |