Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't create a list of bulleted links in a table cell #763

Closed
1 of 4 tasks
avillamaina opened this issue Jun 9, 2020 · 2 comments
Closed
1 of 4 tasks

Can't create a list of bulleted links in a table cell #763

avillamaina opened this issue Jun 9, 2020 · 2 comments
Assignees
Milestone

Comments

@avillamaina
Copy link

avillamaina commented Jun 9, 2020

Thank you for reporting an issue, suggesting an enhancement, or asking a question.

We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the Docs to see if your question is already addressed there. This will help us ensure our documentation covers the most frequent questions.

Category

  • Enhancement
  • Bug
  • Question
  • Documentation gap/issue

Version

Please specify what version of the library you are using: [ 3.2.1 ]

Please specify what version(s) of PowerPoint you are targeting: [ PowerPoint 360 ]

Expected / Desired Behavior / Question

I would like to create a table with a cell containing a list of bullet points linked to different sites.

Observed Behavior

When using the recommended syntax, the generated pptx is corrupt. Powerpoint will repair it, but the links will be gone.

Steps to Reproduce

Try with this code:

var pptx = new PptxGenJS();
var slide = pptx.addSlide();
var rows=[];
rows.push([
		{text: 'Sites', options: {fontFace: 'Arial', fontSize: 16, fill: 'F2F2F2', 
		color: '404040', bold: true, align: 'center', valign: 'middle'}}]);

var arrText = [
{text: "google", options: {bullet: true, hyperlink:{url:'https://www.google.com'}}},
{text: "facebook", options: {bullet: true, hyperlink:{url:'https://www.facebook.com'}}},
{text: "ebay", options: {bullet: true, hyperlink:{url:'https://www.ebay.com'}}}
];

rows.push([{text: arrText, options:{color:'000000'}}]);
slide.addTable(rows);
pptx.writeFile('PptxGenJS-Sandbox-'+getTimestamp())
.then(function(fileName){ console.log('Saved! File Name: '+fileName) });

Thanks for your help!

@srviswanatha
Copy link

Hi,

Is there a solution/workaround implemented for this issue. Any references/pointers would be helpful.

gitbrent added a commit that referenced this issue Apr 28, 2021
@gitbrent gitbrent self-assigned this Apr 28, 2021
@gitbrent gitbrent added this to the 3.6.0 milestone Apr 28, 2021
@gitbrent
Copy link
Owner

Thanks for reporting this @avillamaina

Fixed in head build.

let pptx = new PptxGenJS();
let slide = pptx.addSlide();
let rows = [];
rows.push([{
    text: "Sites",
    options: { fontFace: "Arial", fontSize: 16, fill: "F2F2F2", color: "404040", bold: true, align: "center", valign: "middle" } }
]);

let arrText = [
    { text: "google", options: { bullet: true, hyperlink: { url: "https://www.google.com" } } },
    { text: "facebook", options: { bullet: true, hyperlink: { url: "https://www.facebook.com" } } },
    { text: "ebay", options: { bullet: true, hyperlink: { url: "https://www.ebay.com" } } },
];

rows.push([{ text: arrText, options: { color: "000000" } }]);
slide.addTable(rows);

pptx.writeFile({ fileName: "PptxGenJS-issue-763" });

Screen Shot 2021-04-27 at 23 11 08

gitbrent added a commit that referenced this issue Apr 28, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants