-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Dimensions/Height/Width of PDF file #302
Comments
Never mind, noticed |
Actually, I'd like to reopen this issue. It would seem that that |
same issue |
@wonday do you have any ideas how we can get pdf original size? |
Why need original size? |
@wonday there exists another case, for example, you want to render something on top of pdf file, within specific place described with points depends on real pdf file sizes, so u need to convert it to current sizes using real sizes |
the same document size returns different sizes on ios and android |
Problem is that dimensions provided in the component are of the canvas and not the real page size, native component used in this library currently doesn't provide that, i've made a PR into the native dependency so it can be returned and have the owner of this repo or maybe a PR to return the real page size provided by the native component and not the canvas DImuthuUpe/AndroidPdfViewer#743 DImuthuUpe/AndroidPdfViewer#742 |
@Zloka Did you find any solution? |
@ebrarislami-technoperia No, sadly I did not. Based on the issue you opened your use-case seems similar to mine. |
We calculated dimensions on backend and passed those to the frontend in the
API
El jue., 30 may. 2019 11:35 a. m., ebrarislami-technoperia <
notifications@github.com> escribió:
… @Zloka <https://github.com/Zloka> Did you find any solution?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#302?email_source=notifications&email_token=ABLMHAEH7H63YARGL7Q3S3LPX7Q2FA5CNFSM4GRAMJDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWSP26I#issuecomment-497352057>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLMHAAKHAVGE2NZBZC7Q4DPX7Q2FANCNFSM4GRAMJDA>
.
|
Yup, that was our solution as well: including the dimensions as metadata sent alongside the file. |
how can get exact pdf page height and width on onLoadComplete. |
Maybe try pdfView.getPageSize(currentPage).width? |
Hi @Zloka ! How did you calculate dimensions before putting them as metadata ? |
@meliodev I crop and compress the files in addition to measuring them, so the entire process is probably needlessly complex if all you want to do is calculate the dimensions. Using pdf-lib, you could provide the PDF data as a
|
Thanks @Zloka I'll try it ! |
Is is possible to extract the dimensions of the PDF-file somehow?
My use-case is that I would like to render lists of varying components (headings, paragraphs, buttons and also PDF-files).
fitPolicy={0}
nicely make the PDFs full width, but I can't seem to get them to render without specifying a height. Furthermore, the dimensions of the PDFs can vary (e.g. some are longer), so hard-coding an arbitrary value doesn't work very well.I figured since the screen width is known, it would be possible to set the correct height dynamically if one knows the dimensions of the PDF, but is this at all possible?
The text was updated successfully, but these errors were encountered: