Skip to content
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

Orientation: Landscape, Rendering behaviour #24

Open
ritscAlex opened this issue Aug 3, 2023 · 19 comments
Open

Orientation: Landscape, Rendering behaviour #24

ritscAlex opened this issue Aug 3, 2023 · 19 comments
Assignees
Labels
bug Something isn't working

Comments

@ritscAlex
Copy link

I want to achieve this kind of effect:

image

However, when generating the output, the right side of the site gets pushed within the correct format, I guess:
image

I don't think, that this might be a bug. But might it be possible to render objects that reach above the correct format on all sides of the pdf?

@PejmanNik
Copy link
Owner

hmm, could you please try to implement that layout with PageOverlay ?

@ritscAlex
Copy link
Author

That would work. But also means that only the layout is used for the whole report. Would be nice to be able to have different PageOverlays for different pages.

@PejmanNik
Copy link
Owner

yes, but the overlay will apply to the section's page, you could have multiple sections to limit the PageOverlay.

I'll create a feature request for a page-specific PageOverlay component

@ritscAlex
Copy link
Author

<Section
    margin={pageMargin.None}
    dimension={pageSize.A4}
    orientation={"landscape"}
>

The pageMargin.None forces puppeteer to generator a blank page at the end of the pdf. Setting the margin to pageMargin.Narrow, only the pages with some content get generated.

The problem might be the margin-bottom of the jikji page and/or jikji section

@ritscAlex
Copy link
Author

Ignore my comment above. If the variable 'orientation' within the

Component is set to 'landscape', a new blank page gets rendered each time, no matter of other components like , etc.

@PejmanNik
Copy link
Owner

I think it is related to page size, could you use a custom page size? something like

<Section
    margin={pageMargin.None}
    dimension={{height: '296.7mm', width: '209.7mm'}}
    orientation={"landscape"}
>

@ritscAlex
Copy link
Author

Setting the page size to custom values, doesn't affect anything. However, if the orientation gets set to "portrait" no blank page gets rendered. Also, when using "landscape" as section orientation, the always gets render on a new page expect a margin-bottom of 20px is set.

@PejmanNik
Copy link
Owner

can you decrease the height and width by 1 mm in each try and test? I believe the issue is happening with different page sizes in chromium with standard page sizes.

@ritscAlex
Copy link
Author

I tried to reduce the dimension by 0.1mm from height: '296.8mm', width: '210mm' to height: '296.0mm', width: '209.0mm' with no effect. Then I tried to reduce the dimension by 1mm from '296.8mm', width: '210mm' to '285.8mm', width: '200.0mm' with no effect.

@PejmanNik
Copy link
Owner

ok, thank you. so it should be a bug in the lib layout system, I'll take a look

PejmanNik pushed a commit that referenced this issue Aug 15, 2023
@PejmanNik
Copy link
Owner

Could you please test with version 4.0.1?

@PejmanNik PejmanNik self-assigned this Aug 15, 2023
@PejmanNik PejmanNik added the bug Something isn't working label Aug 15, 2023
@sharathm89
Copy link

sharathm89 commented Aug 16, 2023

@PejmanNik your recent commit or ver 0.4.1 has caused few issues.

On website it looks good but when pdf is generated it creates space in bottom and affects the footer as well...

Below 2 images in bottom looks good in website.

Screenshot 2023-08-15 at 6 55 48 PM Screenshot 2023-08-15 at 6 55 53 PM

Below 2 images in bottom from PDF file.

Screenshot 2023-08-15 at 6 56 51 PM

Screenshot 2023-08-15 at 6 56 58 PM

PDF File with issues
out.pdf

Below is the github repo link which can be used for testing purpose.
Repo Link

or

Sample code setup is done in codesandbox...
https://codesandbox.io/s/report-web-app-mm4l5l?file=/src/App.js

@ritscAlex
Copy link
Author

@sharathm89 he tried to reduce the width & height by -2px:

width: `calc(${dimension.width} - 2px )`,
height: `calc(${dimension.height} - 2px )`,
maxHeight: `calc(${dimension.height} - 2px )`,

In order to fix your table, you could translate your footer component by 2px
transform: translateY(2px);

@ritscAlex
Copy link
Author

@PejmanNik The bug was fixed with version 0.4.1.

@PejmanNik
Copy link
Owner

@sharathm89 it seems i overcorrected the page dimensions, will try to find something in the middle

@sharathm89
Copy link

@sharathm89 it seems i overcorrected the page dimensions, will try to find something in the middle

Sure will be waiting...

@sharathm89
Copy link

Any update on the issue @PejmanNik

@PejmanNik
Copy link
Owner

I'm working on it but why do you need to use the version? Just downgrade to the previous version

@sharathm89
Copy link

sharathm89 commented Aug 21, 2023

ok just taught of keeping the latest version... But yes will downgrade for now

PejmanNik pushed a commit that referenced this issue Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants