Code Monkey home page Code Monkey logo

Comments (5)

jsnee avatar jsnee commented on August 18, 2024

It should be possible to change the output size just by modifying the CSS. I checked that when I originally wrote this extension. But it is possible that some change along the way messed that up. I'll check it out and get back to you!

from vscode-dmbinder.

rjbprime avatar rjbprime commented on August 18, 2024

Further to this I've rendered two documents, one A4, one with default measurements. The default measurements one works, as to be expected. The A4 one renders with white space on the right-hand and bottom-side of the page, and adds a blank page afterwards and the bottom of the page on a separate page (edited due to using wrong code). Attached is both the resulting PDF and the file used to generate it. Had to rename A4.md to A4.txt, so that it would upload to github.

A4.txt

A4.pdf

from vscode-dmbinder.

jsnee avatar jsnee commented on August 18, 2024

Perfect! Thank you for providing those, they help immensely! I do see what you're seeing and I'll work on the fix!

from vscode-dmbinder.

jsnee avatar jsnee commented on August 18, 2024

Fixed in version 0.5.7

from vscode-dmbinder.

jsnee avatar jsnee commented on August 18, 2024

I will add additional features in a future version that will allow you to set the paper size for an entire campaign, but for your benefit, I made a quick fix for you to be able to set it on a per document basis until then! Simply set the page size at the very beginning (make sure there are no empty lines or any other text before this block or it will be rendered instead of interpreted as PDF options) of the markdown file like so:

---
pageSize: A4
---

<style>
...
</style>

Lorem ipsum
...

Notes

  • For your reference (or anybody else's) until I can update the documentation, you can find a list of pageSize options in the changelog here.
    • These are defined by the Puppeteer library, so apologies if there are any paper sizes not supported.
  • This options block isn't required for any markdown files, just the ones where you want to set the PDF's page size
    • If you omit this option (or the whole block from --- to ---) from a markdown file, it simply defaults to the 'Letter' setting
  • This does not fix needing to include custom CSS styles (at least not yet)
    • If I remember to, I'll come back and comment on this issue when I add the ability to simply specify this option and not need any additional CSS styles to render non US Letter sized documents

from vscode-dmbinder.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.