- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 03:36 AM
Hallo SN,
I found this tutorial on how to generate pdf in geneva. (PDF Generation in Geneva ). I am trying to generate the same in Helsinki. I cant to seem to get it to work. Is there a method to get it to work in Helsinki?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 03:47 AM
Simplified code (Helsinki AJAX Script Include) for generating a PDF from HTML
example method you can call from a UI action (obviously you would want to replace the hardcoded bits with what you require)
var PDF = Class.create();
PDF.prototype = Object.extendsObject(AbstractAjaxProcessor, {
_document : null,
example : function (){
this.createPDF('<p>Hello World!</p>', //HTML to convert to PDF
'incident', //Attach PDF to table
'd324db7d2b9aa20072675aa419da1547', //Attach PDF to record/sys_id
'myFile.pdf'); //attachment filename
},
createPDF : function(html, table, sys_id, filename) {
var pdfDoc = new GeneralPDF.Document(null, null, null, null, null, null);
this._document = new GeneralPDF(pdfDoc);
this._document.startHTMLParser();
this._document.addHTML(html);
this._document.stopHTMLParser();
this._saveAs(table, sys_id, filename);
},
_saveAs : function (table, sys_id, filename){
var att = new GeneralPDF.Attachment();
att.setTableName(table);
att.setTableId(sys_id);
att.setName(filename);
att.setType('application/pdf');
att.setBody(this._document.get());
GeneralPDF.attach(att);
},
type: 'PDF'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2024 12:17 AM
Hello ochiengboniface,
So the route you have tried is it working?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2016 03:47 AM
Simplified code (Helsinki AJAX Script Include) for generating a PDF from HTML
example method you can call from a UI action (obviously you would want to replace the hardcoded bits with what you require)
var PDF = Class.create();
PDF.prototype = Object.extendsObject(AbstractAjaxProcessor, {
_document : null,
example : function (){
this.createPDF('<p>Hello World!</p>', //HTML to convert to PDF
'incident', //Attach PDF to table
'd324db7d2b9aa20072675aa419da1547', //Attach PDF to record/sys_id
'myFile.pdf'); //attachment filename
},
createPDF : function(html, table, sys_id, filename) {
var pdfDoc = new GeneralPDF.Document(null, null, null, null, null, null);
this._document = new GeneralPDF(pdfDoc);
this._document.startHTMLParser();
this._document.addHTML(html);
this._document.stopHTMLParser();
this._saveAs(table, sys_id, filename);
},
_saveAs : function (table, sys_id, filename){
var att = new GeneralPDF.Attachment();
att.setTableName(table);
att.setTableId(sys_id);
att.setName(filename);
att.setType('application/pdf');
att.setBody(this._document.get());
GeneralPDF.attach(att);
},
type: 'PDF'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2017 07:53 PM
Hi Wallace,
could you give me a example about how add css and image into PDF file with this solution?
thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2017 02:12 AM
Hi Hung,
You can make use of the native 'font' tags to control things like font color, size and background color, some inline css attributes are also allowed like 'font-size'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2017 08:57 AM
Hi Abd El-Rhman,
I am having problem with table borders. I am unable to process table styles - do you have any idea how to do this?
Thanks for any suggestion.
Regards,
Victor Olufowobi