Closed MoSelim closed 7 years ago
I've been using pdfmake for more than a year, suddenly today I generated a report and the font render was corrupted, letters mixed up and squares rendered. I tried it on the playground and the result is the same. the document definition is:
{ "content": [ { "table": { "widths": [ "*" ], "body": [ [ { "text": "Discover Your Talents", "bold": true, "fontSize": 40, "fillColor": "grey", "color": "white", "alignment": "center" } ] ] }, "margin": [ 0, 200, 0, 0 ], "layout": "noBorders" }, { "text": "Candidate: Nariman Essam", "bold": true, "fontSize": 25, "margin": [ 0, 40, 0, 0 ], "color": "grey", "alignment": "center" }, { "text": "Date Completed: Sep 16, 2017", "bold": true, "fontSize": 20, "margin": [ 0, 20, 0, 0 ], "color": "black", "alignment": "center", "pageBreak": "after" }, { "text": "Candidate Potentiality Profile Report", "style": "header", "alignment": "center" }, { "columns": [ { "text": "Candidate Name: Nariman Essam", "style": "subheader", "alignment": "left" }, { "text": "Job: Mark", "style": "subheader", "alignment": "right" } ] }, { "columns": [ { "text": "Email: nariman@gmail.com", "style": "subheader", "alignment": "left" }, { "text": "Organization: DYT", "style": "subheader", "alignment": "right" } ] }, { "columns": [ { "text": "Candidate ID: 8", "style": "subheader", "alignment": "left" }, { "text": "Report Date: Sep 16, 2017", "style": "subheader", "alignment": "right" } ] }, { "style": "sectionheader", "table": { "widths": [ "*" ], "body": [ [ "Section A: Introduction" ] ] }, "layout": {} }, { "text": "The purpose of the report", "style": "pheader" }, "The purpose of this report is to provide you with an insight into your and innate preferences and inner motives in order to expand your awareness of the factors that would define your career success and help you make an informed choices and decisions about your career. It is important to remember that your report is based on your responses to the questionnaire. It therefore may not exactly reflect how others view you.", { "style": "sectionheader", "table": { "widths": [ "*" ], "body": [ [ "Section B: Job Potentiality" ] ] }, "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "B.1 Introduction:" ] ] }, "margin": [ 20, 0, 0, 10 ], "layout": {} }, { "text": [ { "text": "Job Potentiality", "bold": true }, "is influenced by the", { "text": " congruence between a person’s potential ", "bold": true }, "(ability, personality, career values, career interests, and motivated skills) ", { "text": "with the requirements of the job", "bold": true }, ". Also, it can be influenced by ", { "text": "the work environment includes;", "bold": true }, " co-workers, pay, job conditions, supervision, and benefits. " ], "margin": [ 30, 0, 0, 10 ] }, { "text": [ { "text": "Job Potentiality", "bold": true }, " has been linked to productivity, motivation, absenteeism/tardiness, accidents, mental/physical health, and general life satisfaction." ], "margin": [ 30, 0, 0, 10 ] }, { "text": "Job Potentiality represents the candidate's Job Satisfaction Level.", "bold": true, "margin": [ 30, 0, 0, 10 ] }, { "text": [ { "text": "Job Satisfaction Level Definition:", "bold": true }, " It is the extent to which an individual like (satisfaction) or dislike (dissatisfaction) his/her jobs." ], "margin": [ 30, 0, 0, 10 ] }, { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "B.2 Job Potentiality Level:" ] ] }, "margin": [ 20, 0, 0, 10 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "B.3 Job Potentiality Dimensions:" ] ] }, "margin": [ 20, 0, 0, 10 ], "layout": {} }, { "style": "sectionheader", "table": { "widths": [ "*" ], "body": [ [ "Section C: Analysis" ] ] }, "layout": {} }, [ { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "C.1 Career Values" ] ] }, "margin": [ 20, 0, 0, 0 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*", "*", "*" ], "body": [ [ { "text": "Decrease Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Highly Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" } ], [ "Honesty And Integrity", "", "" ], [ "Work-Life Balance", "", "" ], [ "Advancement", "", "" ], [ "Job Tranquility", "", "" ], [ "", "Recognition", "" ], [ "Family", "", "" ], [ "Fast Pace", "", "" ], [ "Help Others", "", "" ], [ "", "Public Contact", "" ], [ "Group & Team", "", "" ] ] }, "fontSize": 9, "margin": [ 20, 10, 0, 10 ] } ], [ { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "C.2 Abilities" ] ] }, "margin": [ 20, 0, 0, 0 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*", "*", "*" ], "body": [ [ { "text": "Decrease Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Highly Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" } ], [ "Numerical", "", "" ], [ "3D", "", "" ], [ "Verbal", "", "" ], [ "Visual", "", "" ] ] }, "fontSize": 9, "margin": [ 20, 10, 0, 10 ], "pageBreak": "after" } ], [ { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "C.3 Career Interests" ] ] }, "margin": [ 20, 0, 0, 0 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*", "*", "*" ], "body": [ [ { "text": "Decrease Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Highly Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" } ], [ "Artisitic", "", "" ], [ "Social", "", "" ], [ "", "Enterprising", "" ] ] }, "fontSize": 9, "margin": [ 20, 10, 0, 10 ] } ], [ { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "C.4 Motivated Skills" ] ] }, "margin": [ 20, 0, 0, 0 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*", "*", "*" ], "body": [ [ { "text": "Decrease Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Highly Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" } ], [ "Customer Service", "", "" ], [ "Supervise", "", "" ], [ "Teach, Train", "", "" ], [ "Monitor", "", "" ], [ "Maintain Records", "", "" ], [ "Deal With Feelings", "", "" ], [ "Manage Time", "", "" ], [ "Mentor", "", "" ], [ "Delegate", "", "" ], [ "", "Implement", "" ] ] }, "fontSize": 9, "margin": [ 20, 10, 0, 10 ], "pageBreak": "after" } ], [ { "style": "subsectionheader", "table": { "widths": [ "*" ], "body": [ [ "C.5 Personality Traits" ] ] }, "margin": [ 20, 0, 0, 0 ], "layout": {} }, { "style": "subsectionheader", "table": { "widths": [ "*", "*", "*" ], "body": [ [ { "text": "Decrease Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" }, { "text": "Highly Increase Satisfaction Level", "fontSize": 10, "bold": true, "color": "grey" } ], [ "Seek High Quality", "", "" ], [ "", "Details Oriented", "" ], [ "", "Organized", "" ], [ "Introvert", "", "" ], [ "Observer", "", "" ], [ "Perfectionist", "", "" ], [ "", "Mediator", "" ], [ "", "Cooperative", "" ], [ "Listener", "", "" ], [ "", "Thoughtful", "" ] ] }, "fontSize": 9, "margin": [ 20, 10, 0, 10 ] } ] ], "styles": { "header": { "fontSize": 18, "bold": true, "margin": [ 0, 0, 0, 10 ] }, "subheader": { "fontSize": 14, "bold": true, "margin": [ 0, 10, 0, 5 ] }, "subsectionheader": { "fontSize": 14, "bold": true }, "pheader": { "fontSize": 12, "bold": true, "margin": [ 0, 10, 0, 5 ] }, "sectionheader": { "fontSize": 16, "bold": true, "margin": [ 0, 20, 0, 10 ], "color": "teal" } }, "defaultStyle": {} }
Output PDF file is too long, where exactly is problem?
I found the problem, chrome didn't ignore invisible characters produced from my code so the font is corrupted. It has nothing to do with the library.
I've been using pdfmake for more than a year, suddenly today I generated a report and the font render was corrupted, letters mixed up and squares rendered. I tried it on the playground and the result is the same. the document definition is: