Skip to content
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

Y position of document not updated after adding image #1523

Open
Pyozer opened this issue May 31, 2024 · 4 comments
Open

Y position of document not updated after adding image #1523

Pyozer opened this issue May 31, 2024 · 4 comments

Comments

@Pyozer
Copy link

Pyozer commented May 31, 2024

Bug Report

Description of the problem

On version 0.14.0 (and lower?), when you add an image, the Y position of the document is automatically updated.
So if we add another image, with moveDown or not, it will be below the first (same with the text, etc...).

But now in version 0.15.0, Y position is not updated after adding an image, so when we add another element (image or text), it is on top of the first one.

So there is a bug/regression in the new version 0.15.0.

Code sample

const doc = new PDFDocument({ layout: 'portrait', size: 'A4' });

doc.image(path.join(assetsPath, '/test1.jpg'), { width: 250 });
doc.moveDown(5);
doc.image(path.join(assetsPath, '/test2.jpg'), { width: 250 });

doc.end();

Here is the result of the sample code in 0.14.0 :

Capture d’écran 2024-05-31 à 18 45 08

And here the result in 0.15.0 :

Capture d’écran 2024-05-31 à 18 43 22

Your environment

  • pdfkit version: 0.15.0
  • Node version: 20
  • Browser version (if applicable):
  • Operating System: MacOS
@NormandoHall
Copy link

Same here

@BracketJohn
Copy link

We are also experiencing this on our project!

@micael-pn
Copy link

Hello,
We also experience the same issue. Can you please help ?
Thank you !

@sepiaflux
Copy link

Experiencing the same problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants