Code Monkey home page Code Monkey logo

Comments (5)

SkylerA avatar SkylerA commented on August 11, 2024

I'm running into the same issue @shaejaz, did you find any solution to this? Trying to hardcode some margins for a job near the bottom of the page to make the page break a bit cleaner.

from open-resume.

p0lygun avatar p0lygun commented on August 11, 2024

where are you adding the padding/margins?
By adding padding at

, I can see the changes in the pdf

from open-resume.

shaejaz avatar shaejaz commented on August 11, 2024

@SkylerA No I haven't managed to find the cause for it yet. My guess is the underlying react-pdf might have a bug or is not being used correctly.

Imo, it's a minor inconvenience since the realtime PDF view gets updated just fine. It's the download link that has the issue. So once you've made your changes on the layout, restart the dev server and the download URL would give you the updated layout.

from open-resume.

SkylerA avatar SkylerA commented on August 11, 2024

@p0lygun That is where I was trying. I also tried wrapping the individual components in a view with new styles. The changes show up in the preview window, however when you click download link the styles are lost. Restarting the server after the changes didn't seem to help either.

I believe even the default style might be ignored to some degree as I've noticed that if you add a new work experience with the text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur id tortor eget erat ornare tempus the preview will wrap tempus to the next line, but when you download the pdf you'll actually see it all fit into 1 line. Note this example is most likely style and text dependent (I'm using Roboto, 11pt, standard, Letter)

from open-resume.

SkylerA avatar SkylerA commented on August 11, 2024

Did a bit more research and it looks like this might be an issue in react-pdf itself.

diegomura/react-pdf#1076 mentions that it might be padding/margin specific which i was able to confirm by applying style={{ margin: "3rem", color: "red" }} to the component I link in my previous post. Both the margin and color change render in the preview, but only the color change is saved to pdf.

This post further theorizes that it might be related to string units not surviving being passed as props which i was able to recreate by changing margin: "3rem" to margin: 48 and the change was saved to the pdf.

So I'd say if anyone needs to tweak layout for now, try converting your units to pixels and then setting the value as a number instead of a string. Note i also had to restart server and possibly reload page for changes to go through sometimes, didn't dial down the specific sequence

from open-resume.

Related Issues (20)

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.