react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Border and margin issue

Open chemseddine201 opened this issue 1 year ago • 2 comments

Page Border I encountered an issue when trying to apply a page border with a margin. The Right border of the page disappeared when applying the margin, and I noticed that the page shifted to the right when applying the margin.

image

the code applied: const baseStyles = StyleSheet.create({ page: { paddingVertical: 10, paddingHorizontal: 10, /* border: "1px solid #606060" */ margin:10, borderColor: '#606060', borderWidth: '2pt', borderStyle: 'solid', }})

please any example or suggestion to solve this issue?

chemseddine201 avatar Jan 05 '25 22:01 chemseddine201

Page margin does not make any sense, as there's nothing outside of it. Keep the page padding, and add the border to a View inside of it

diegomura avatar Jan 11 '25 04:01 diegomura

Page margin does not make any sense, as there's nothing outside of it. Keep the page padding, and add the border to a View inside of it

Here's a clearer and more detailed version of the comment:

  • content misalignment: the page margin caused all content to shift rightward instead of maintaining proper alignment.

  • border rendering bug: when attempting to fix this by applying a border to the inner view element, the border failed to automatically adjust (not closed at the end of page) when new pages were dynamically added.

I recommend testing these margin and border behaviors in a live environment to verify.

chemseddine201 avatar Jan 11 '25 10:01 chemseddine201