-
Notifications
You must be signed in to change notification settings - Fork 11
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
Cannot add logo before content #9
Comments
Hi, i have tried to retrace your issue, but i can't confirm this. Can you explain that in more detail? Maybe is your image too big for this section? When you need a Image/Logo at the same position on every Page, have you tried to use a background image? For example see the Invoice Test. A padding/margin for images would be nice. I will add this in the next release. |
To reproduce this issue add footer into your template and just image (instead image move on top in content position moving to footer, until I will not add some text to content. var doc = require('lx-pdf')('templates/export_search_pdf.json'); "footer": { |
Another problem I cannot move image some pixels down (top: XXX) I tried move section "format": { |
Okay, now i can confirm that issue. I will fix that. |
I need to generate PDF with logo on top. Looks like bug in your code I can only add after some content text. Also I can only set width and height how about padding/position (top/left)
lxDocument.addImage('content', './logo.png');
lxDocument.addImage('header', './logo.png');
lxDocument.addImage('content', './logo.png', {top:0});
Workaround create patch on line 1025
var imgData = PDFImage.open(entry.image.filename),
imgHeight = options.height || imgData.height,
reqPageBreak = (sectionInfo.topIndex + imgHeight > sectionDimension.height),
imageTop = options.top === undefined ? reqPageBreak ? sectionDimension.top || 0 : null : options.top;
The text was updated successfully, but these errors were encountered: