- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2017 04:43 PM
Hi Syed,
I am trying to generate a password protected pdf, I also tried using "setEncryption" function, but doesn't seem to work,
//this.writer = iTextPDFUtil.PdfWriter.getInstance(this.document, this.outputStream);
//PdfWriter writer = PdfWriter.getInstance(document, file);
//writer.setEncryption(USER_PASS.getBytes(), OWNER_PASS.getBytes(),PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128);
var USER_PASS = [72, 101, 108, 108, 111, 49, 50, 51]; //"Hello123";
var OWNER_PASS = [79, 119, 110, 101, 114, 49, 50, 51]; //"Owner123";
this.writer.setEncryption(USER_PASS, OWNER_PASS, this.writer.ALLOW_PRINTING, this.writer.STANDARD_ENCRYPTION_40);
Any suggestions.
Thanks
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2017 04:28 PM
For anyone who is facing broken HTML borders functionality in Jakarta (i.e. HTML borders are not showing up), this functionality was broken in Jakarta and then fixed in Kingston. Technical Support has recently released a HotFix for Jakarta (i.e. Jakarta Patch 5 Hotfix 3) which resolves this issue. This Hotfix can be requested from technical support by opening up a support incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2017 06:49 AM
Hi Syed,
In Geneva the PDF generator worked fine, but now in Jakarta it works, but I'm not getting my Header Images from my template record?
Have you got the same issues?
Gr. Roanld
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2017 05:10 AM
Hi Ronald, it seems that there is a new restriction on the size of the images in the newer Jakarta version. They are stated here from what i have found: HR Document Templates
It basically states:
- The logo image to use in your header. The header image can be a maximum of 50px high. If your letterhead includes a logo and text, ensure that the logo image includes the text, as you can only configure the image in the header.
- The logo image to use in your footer, if applicable. The logo image can be a maximum of 15px high. You can configure both an image and text in the footer.
Also the way they accept images has changed from the previous versions. Take a look at the HR plugins example, but doing a direct image works better like:
this.headerImage = instance + "Print-logo-workorder.jpgx";
I ended up sending in the image like this:
var headerId = gr.u_header.getDisplayValue() ? gr.u_header.getDisplayValue().substring(0, gr.u_header.getDisplayValue().indexOf('.iix')) : '';
this.headerImage = this._getTemplateImage(headerId);
And the function invoked looked like this:
_getTemplateImage: function(attachmentSysId){
// gs.addInfoMessage('Going to add image of ID= ' + attachmentSysId);
if(gs.nil(attachmentSysId))
return '';
var imageAttachment = new GlideRecord('sys_attachment');
imageAttachment.get(attachmentSysId);
var binaryData = new GlideSysAttachment().getBytes(imageAttachment);
var base64Image = GlideStringUtil.base64Encode(binaryData);
if (!gs.nil(base64Image))
return '<img src=\"data:image/png;base64,'+ base64Image + '"/>';
else
gs.info('Issue found with getting the image');
return '';
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2017 10:05 PM
For what I can see, HTML borders do work - but they do only with the tag attribute (<table border="1"...) and not with the CSS styling (<table style="border:1px solid black;"...)
Does anybody know how to add a page break / new page though? We are discussing the issue with SNsupport but nothing seems to work.