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

PPT repair issue for long text. #1008

Closed
Naveencheekoti17 opened this issue Oct 6, 2021 · 4 comments · Fixed by #1028
Closed

PPT repair issue for long text. #1008

Naveencheekoti17 opened this issue Oct 6, 2021 · 4 comments · Fixed by #1028
Assignees
Milestone

Comments

@Naveencheekoti17
Copy link

Naveencheekoti17 commented Oct 6, 2021

I am facing the issue with long text for tables. Text is having more than 150 characters

var pptx = new PptxGenJS();
var slideIndex = pptx.addSlide();
var projRows = [
    [
        { text: "id", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", align: "left", valign: "middle" } },
        { text: "First item Desc", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Impact", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Owner", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Created Date", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Due Date", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Status", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
        { text: "Update", options: { fontFace: "Segoe UI", fontSize: 7, bold: true, fill: "1F3864", color: "ffffff", valign: "middle" } },
    ],
    [
        { text: "1", options: { fontSize: 7, align: "left", valign: "middle" } },
        {
            text: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna.",
            options: { fontSize: 7, align: "left", valign: "middle" },
        },
        { text: "Adam", options: { fontSize: 7, align: "left", valign: "middle" } },
        { text: "Aenean commodo ligula eget dolor. Aenean massa.", options: { fontSize: 7, valign: "middle" } },
        { text: "20-10-2021", options: { fontSize: 7, valign: "middle" } },
        { text: "01-11-2021", options: { fontSize: 7, valign: "middle" } },
        { text: "Pending", options: { fontSize: 7, valign: "middle" } },
        { text: "24-10-2021", options: { fontSize: 7, valign: "middle" } },
    ],
];
slideIndex.addTable(projRows, {
    x: 0.2,
    y: 3.53,
    w: 9.52,
    colW: [0.5, 1.8, 3, 0.65, 0.8, 0.7, 0.55, 1.52],
    autoPage: true,
    autoPageRepeatHeader: true,
    verbose: true,
    border: { pt: 0.1, color: "1F3864" },
});
pptx.writeFile();

PPT generated successfully. But When i am trying to open the PPT, It is showing a message like "PPT repaired".
How to fix this issue. Can anyone help on this issue. What are parameters need to change for fixing this issue?

@gitbrent gitbrent self-assigned this Oct 17, 2021
@gitbrent gitbrent added this to the 3.9.0 milestone Oct 17, 2021
@JunlinZhu-Tommy
Copy link

Any one knows how to fix it?

@gitbrent
Copy link
Owner

I'm working on the issue now.

@gitbrent
Copy link
Owner

gitbrent commented Nov 11, 2021

This issue is fixed with the newest branch merge and will be released with v3.9.0

Thanks for reporting this @Naveencheekoti17

gitbrent added a commit that referenced this issue Nov 11, 2021
@MohammedShakkir
Copy link

MohammedShakkir commented Mar 27, 2023

@gitbrent Still am facing issue in 3.11.0 version as well. If text length is more than 20 it started throwing repair error while opening ppt. For some coloumn allowing up to 45 or more Kindly advise what am doing wrong.
Uploading 16799177252386951256298149013012.jpg…

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants