You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a pdf document that has an opaque base layer to add three layers with transparent backgrounds onto. So far I've been able to add a new page to the base document which Gimp then recognizes as a layer (Acrobat still shows them as pages, not layers). But the background is opaque so you can only see one layer at a time.
Is there a better way to do what I'm trying to do?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to create a pdf document that has an opaque base layer to add three layers with transparent backgrounds onto. So far I've been able to add a new page to the base document which Gimp then recognizes as a layer (Acrobat still shows them as pages, not layers). But the background is opaque so you can only see one layer at a time.
Is there a better way to do what I'm trying to do?
`const pdfDoc = await PDFDocument.create();
const layer1 = pdfDoc.addPage(width,height);
const layer2 = pdfDoc.addPage(width,height);
const layer3 = pdfDoc.addPage(width,height);
const layer3 = pdfDoc.addPage(width,height);
layer1.moveTo(x,y);
layer2.moveTo(x,y);
layer3.moveTo(x,y);
layer4.moveTo(x,y);
layer1.drrawSvgPath(layer1String,{scale: pdfScale});
layer1.drrawSvgPath(layer2String,{scale: pdfScale, opacity: 0});
layer1.drrawSvgPath(layer3String,{scale: pdfScale, opacity: 0});
layer1.drrawSvgPath(layer4String,{scale: pdfScale, opacity: 0});
let pdfBytes = await pdfDoc.save();`
Beta Was this translation helpful? Give feedback.
All reactions