-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Image over canvas in background #2709
Comments
Fanfong68
changed the title
How to use background image and canva together
Image over canvas in background
Mar 22, 2024
You can use stack, example: var dd = {
content: [
'First paragraph',
'Another paragraph, this time a little bit longer to make sure, this line will be divided into at least two lines'
],
background: function(currentPage, pageSize) {
return {
stack: [
{
image: 'sampleImage.jpg',
width: pageSize.width,
height: pageSize.height,
absolutePosition: { x: pageSize.width * 0.37, y: pageSize.height * 0.001 },
// opacity: 0.3,
// margin: [0, -120, 0, 0]
},
{
canvas: [
{
type: 'rect',
x: pageSize.width * 0.42,
y: pageSize.height * 0.16,
w: pageSize.width * 0.08,
h: pageSize.height * 0.04,
lineColor: 'black',
},
{
type: 'rect',
x: pageSize.width * 0.84,
y: pageSize.height * 0.16,
w: pageSize.width * 0.08,
h: pageSize.height * 0.04,
lineColor: 'black',
},
{
type: 'rect',
x: pageSize.width * 0.64,
y: pageSize.height * 0.32,
w: pageSize.width * 0.28,
h: pageSize.height * 0.12,
lineColor: 'black',
},
]
}]
};
},
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to use background canva and image together. I am going to generate a certificate, so i need a frame and a few rectangles as the background. Below is my code:
The text was updated successfully, but these errors were encountered: