mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +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
|
// set page size
|
||||||
dd.pageSize = invoice.account.page_size;
|
dd.pageSize = invoice.account.page_size;
|
||||||
|
|
||||||
|
// dd.watermark = 'PAID';
|
||||||
|
|
||||||
pdfMake.fonts = {}
|
pdfMake.fonts = {}
|
||||||
fonts = window.invoiceFonts || invoice.invoice_fonts;
|
fonts = window.invoiceFonts || invoice.invoice_fonts;
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@
|
|||||||
var watermark = page.watermark;
|
var watermark = page.watermark;
|
||||||
|
|
||||||
pdfKitDoc.fill('black');
|
pdfKitDoc.fill('black');
|
||||||
pdfKitDoc.opacity(0.6);
|
pdfKitDoc.opacity(0.1);
|
||||||
|
|
||||||
pdfKitDoc.save();
|
pdfKitDoc.save();
|
||||||
pdfKitDoc.transform(1, 0, 0, -1, 0, pdfKitDoc.page.height);
|
pdfKitDoc.transform(1, 0, 0, -1, 0, pdfKitDoc.page.height);
|
||||||
@ -477,8 +477,13 @@
|
|||||||
var encoded = watermark.font.encode(watermark.text);
|
var encoded = watermark.font.encode(watermark.text);
|
||||||
pdfKitDoc.addContent('BT');
|
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('' + (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');
|
// http://stackoverflow.com/a/32658671
|
||||||
pdfKitDoc.addContent('<' + encoded.encodedText + '> Tj');
|
//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.addContent('ET');
|
||||||
pdfKitDoc.restore();
|
pdfKitDoc.restore();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user