mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Fix for pdfmake watermark
This commit is contained in:
parent
14352741be
commit
4a94633add
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -114,6 +114,8 @@ function GetPdfMake(invoice, javascript, callback) {
|
||||
// set page size
|
||||
dd.pageSize = invoice.account.page_size;
|
||||
|
||||
// dd.watermark = 'PAID';
|
||||
|
||||
pdfMake.fonts = {}
|
||||
fonts = window.invoiceFonts || invoice.invoice_fonts;
|
||||
|
||||
|
@ -466,7 +466,7 @@
|
||||
var watermark = page.watermark;
|
||||
|
||||
pdfKitDoc.fill('black');
|
||||
pdfKitDoc.opacity(0.6);
|
||||
pdfKitDoc.opacity(0.1);
|
||||
|
||||
pdfKitDoc.save();
|
||||
pdfKitDoc.transform(1, 0, 0, -1, 0, pdfKitDoc.page.height);
|
||||
@ -477,8 +477,13 @@
|
||||
var encoded = watermark.font.encode(watermark.text);
|
||||
pdfKitDoc.addContent('BT');
|
||||
pdfKitDoc.addContent('' + (pdfKitDoc.page.width/2 - watermark.size.size.width/2) + ' ' + (pdfKitDoc.page.height/2 - watermark.size.size.height/4) + ' Td');
|
||||
pdfKitDoc.addContent('/' + encoded.fontId + ' ' + watermark.size.fontSize + ' Tf');
|
||||
pdfKitDoc.addContent('<' + encoded.encodedText + '> Tj');
|
||||
// http://stackoverflow.com/a/32658671
|
||||
//pdfKitDoc.addContent('/' + encoded.fontId + ' ' + watermark.size.fontSize + ' Tf');
|
||||
//pdfKitDoc.addContent('<' + encoded.encodedText + '> Tj');
|
||||
|
||||
pdfKitDoc.addContent('/ ' + watermark.size.fontSize + ' Tf');
|
||||
pdfKitDoc.addContent('(' + watermark.text + ') Tj');
|
||||
|
||||
pdfKitDoc.addContent('ET');
|
||||
pdfKitDoc.restore();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user