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

feat: Support printing mixed page sizes #912

Merged
merged 2 commits into from
May 4, 2022
Merged

Conversation

MurakamiShinyu
Copy link
Member

This change enables mixed page sizes in output PDF together with the following change in vivliostyle-cli:

When multiple page sizes are specified, as in the example in Issue 751, the largest page size both vertically and horizontally are used in PDF output from Vivliostyle.js.
Then the PDF is post-processed in the Vivliostyle CLI to set the multiple page sizes as specified.

@vercel
Copy link

vercel bot commented May 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vivliostyle ✅ Ready (Inspect) Visit Preview May 4, 2022 at 8:17AM (UTC)

@MurakamiShinyu
Copy link
Member Author

Tested: #751 (comment)

…s files

There have been four same stylesheet sets (vivliostyle-viewport.css and vivliostyle-viewport-screen.css) in the following files:

- packages/core/resources/vivliostyle-viewport(-screen).css
- packages/viewer/resources/vivliostyle-viewport(-screen).css
- bundled copy in packages/core/src/vivliostyle/assets.ts
- bundled copy in packages/react/src/renderer.tsx

These are redundant and hard to maintain keeping consistent style rules in these all files.
To resolve this problem, this commit removes these stylesheets except in packages/core/src/vivliostyle/assets.ts,
and modifies the AdaptiveViewer constructor so that the style elements are dynamically generated using the stylesheets in packages/core/src/vivliostyle/assets.ts.
In addition, it moves the code that generates the style element for text-polyfill-css from text-polyfill.ts to the AdaptiveViewer constructor.
- resolves #751

This change enables mixed page sizes in output PDF together with the following change in vivliostyle-cli:

- vivliostyle/vivliostyle-cli#278

When multiple page sizes are specified, as in the example in Issue 751,
the largest page size both vertically and horizontally are used in PDF output
from Vivliostyle.js.
Then the PDF is post-processed in the Vivliostyle CLI to set the multiple page sizes as specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support printing mixed page sizes
1 participant