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
add paper size to document information #6990
Comments
And can it include portrait/landscape? |
What is the expected behavior if multiple page sizes/orientations are used, i.e., some pages are A4 portrait, but some are A3 landscape for example? How do other viewers do that? |
and also we need to deal with internationalization and localization, e.g.
|
Re: rotation. I'm going to check what PR 8043 does for me. That may fix my problem. It looks like I really need to read PR 8043 and #6103 properly, and make sure I'm on a late release with those fixes applied. Re: multi-size. Dunno if any print backends support that without splitting the printout into multiple print jobs. If you don't split the print job, you have "print on biggest" or "scale to smallest" as sane options. Cups includes an media size header with every print job, so Linux and MacOS are limited to one-size per print-job, as far as I know. Re: localisation. |
@berenddeschouwer I don't think any of the above related to the OP |
@timvandermeij, SumatraPDF displays the size of the browsed page (the one that has the number in the toolbar).
@yurydelendik, I don’t think And as far as i know, page dimensions are specified in points inside the PDF document. So PDF.js should use the default dimension unit from OS. |
@ousia what is the expected page size for document at https://github.com/mozilla/pdf.js/blob/master/test/pdfs/sizes.pdf ? |
@yurydelendik, I don’t understand your question. Size is a property related to the actual page, not to the document. in PDF terms, Which should be the page size in the document you mention? Acrobat Reader displays the dimensions of the displayed page. Here you have it. |
Thank you for providing this information! Now that this is clear, I think this should be good to implement. I'm marking this as a good beginner bug since it should not be too hard. |
I can knock this out if nobody is working on it. |
@loganhuskins It's yours! |
I think I am pretty close, I want to use Should I import |
I've been wrapped up with work, so if you're taking this over I'm good. |
@linton-Portman, in that case adding Letter, portrait would be great. I mean, with standard paper sizes it is useful to provide the standard paper name. See what Evince does: And SumatraPDF: |
That means we need to properly localize all of these name. Is there a short list of popular paper sizes? |
Hi, This will be a lot of if/else statements depending on how many paper sizes are catered for.... |
Notice that A4 size is better to be expressed in mm, e.g. 210mm x 297mm |
@yurydelendik Oh yes i can do that also. |
Here you have a list (that I adapted from ConTeXt). Standard European paper sizes: [A0] [width=841mm, height=1189mm] Standard European less common paper sizes: [B0] [width=1000mm, height=1414mm] Standard European envelope sizes: [C0] [width=917mm, height=1297mm] CD cover paper size: [CD] [width=120mm, height=120mm] American standard paper sizes: [letter] [width=8.5in, height=11in] [legal] [width=8.5in, height=14in] Different sets of envelopes: [envelope 9] [width=8.88in, height=3.88in] I think it is useful to add whether the orientation is portrait or landscape. |
@linton-Portman, from what I see in your screenshots, I have a question: Wouldn’t the following info be better?
I mean, these following adaptations:
If that weren’t possible, portrait or landscape should go inside the parentheses. Many thanks for your contribution. |
@linton-Portman, using I cannot code, so experienced coders may give better advice. (I simply replied to your question, since it remained unanswered). |
All of that needs to be translated. Personally I prefer find 5-10 top most used page sizes and give them names.
Due to that: "8.5 in × 11 in, Letter/Portrait" or just "100mm x 200mm" might look a better choice here |
Yes, but it's also up to localizers for specific culture |
I'm sure core contributors will have open mind about the way this problem will be addressed. Main concern here is that a solution must not be complex and not add burden in future maintenance of the project. Personally, as a first step, I would just add page size information without "nice" names (to avoid their localization), maybe (auto) detect units. The second step would be discussion of the page size name and orientation. |
I tried it, since there has not been communication here since 2 months or so. Apologizes if I should have asked before. |
The pull request above implemented most of this feature. What remains to be done is showing the page size of the currently visible page instead of only from the first one. Optionally letter/portrait and default page sizes (such as A4) can be added, but I don't see that as mandatory for resolving this issue. |
More improvements have been made in #9577, which also implemented showing the page size of the currently visible page. For this issue, only letter/portrait and default page sizes remain. |
The final part is implemented by the pull request above (page orientation and page size names). Closing as fixed. |
Would it be possible that you add paper size to document information?
This is important to know whether the document uses letter or A4 paper size (among others).
The text was updated successfully, but these errors were encountered: