liborm85
Repos
25
Followers
38

Events

closed issue
I need to populate another column in same page once after the first column content is overflowed
Created at 6 days ago
issue comment
I need to populate another column in same page once after the first column content is overflowed

Not supported now. Feature request is here: https://github.com/bpampuch/pdfmake/issues/604

Created at 6 days ago
issue comment
pdfmake.js:73734 Malformed table row

Attach runnable example on playground for reproduce issue.

Created at 1 week ago
"dev-files": "composer.dev-files.json" and options

External json file have same format as in composer.json, example added to readme https://github.com/liborm85/composer-vendor-cleaner/commit/9afcc3429a276cb758608173391f3537c2e95451.

Config options match-case and remove-empty-dirs are in another part of composer.json, is in config attribute. Example is in readme.

Created at 1 week ago

added example for external json file

Created at 1 week ago
closed issue
Support for ₳ character ...

When writing a price value for example: $20 ($ character works) but when trying ₳20 it shows image

Created at 1 week ago
issue comment
Support for Runtime translation (RM #5288)

@dpage Issue is not closed on Redmine.

Created at 1 week ago
closed issue
not able to export all pages of ag grid to pdf file using pdfmake
Created at 2 weeks ago
issue comment
not able to export all pages of ag grid to pdf file using pdfmake

ag grid is not part of pdfmake. Ast on g grid support.

Created at 2 weeks ago
issue comment
Support for ₳ character ...

Font probably does not support this character. Use font which support required character.

Created at 2 weeks ago

Fixed refetching fonts from URL #2477

Created at 2 weeks ago
issue comment
Prefetching custom fonts

Fixed by commit https://github.com/bpampuch/pdfmake/commit/a6a7668e7ab15d7995623f91594c2a663ce781ff.

Created at 2 weeks ago

Fixed refetching fonts from URL #2477

Created at 2 weeks ago
issue comment
Custom Font Collection Via URL Protocol Does Not Seem To Work

Loading TTC from URL fixed by commit https://github.com/bpampuch/pdfmake/commit/eebdf143ca9e6e6bdec0b51d3e516f0806e2348c.

Created at 2 weeks ago

fixed TrueType Collection loading from URL #2456

Created at 2 weeks ago

fixed TrueType Collection loading from URL #2456

Created at 2 weeks ago

deploy

Created at 3 weeks ago
pull request closed
Fix an example of using images

Hi, it left a comma in the example, so i just added it to avoid problems with it.

Created at 3 weeks ago
issue comment
Fix an example of using images

Thanks. Merged via https://github.com/pdfmake/docs/commit/98fb40b382907cec99273231e7570171cc1e8e72.

Created at 3 weeks ago

Update images.md

Missing comma after strawberries url.

Created at 3 weeks ago

Update images.md

Missing comma after strawberries url.

Created at 3 weeks ago
closed issue
Issue with 0.3. - beta 2 version in aws lambda

I'm testing out 0.3 beta 2 versions in my AWS lambda and there is a strange issue with the images that is part of the pdf. For my first request ,the pdf is generated correctly with the images. When the lambda is warm (meaning I'm requesting again in less than 5min), all the text details of the pdf is updated to the new content, but the images displayed on the created pdf are still the old one even though I'm sending new data to the pdf make method.

Again if I try the Lambda after 10 min for the second request, I get the correct pdf. I'm not sure if the issue is due to the beta version,below are the method details,

pdf make version : 0.3.0-beta.2 Method:

export async function createLabelPdf(requestPdf) {
  try {
    let PdfPrinter = require("pdfmake");
    const fonts = {
      Roboto: {
        normal: "fonts/hind-all-400-normal.woff",
        bold: "fonts/hind-all-600-normal.woff",
      },
    };
    PdfPrinter.addFonts(fonts);
    console.log(`Request send to pdf is ${JSON.stringify(requestPdf)}`);
    let pdf = PdfPrinter.createPdf(requestPdf);
    let pdfData = await pdf.getBase64();
    
    return pdfData;
  } catch (exception) {
    console.error(`Exception in creation of PDF ${exception.message}`);
    return false;
  }
}

Sample requestPdf format,

{
  content: [
    {
      table: {
        heights: [100, 100],
        widths: [200, 200],
        body: [
          [
            { text: "test", fontSize: 25, bold: true, alignment: "center" },
            {
              image: "",
              width: 200,
              alignment: "center",
            },
          ],
        ],
      },
    },
    {
      table: {
        heights: [20, 20],
        widths: [200, 200],
        body: [
          [
            {
              colSpan: 2,
              image: "",
              width: 200,
              alignment: "center",
              border: [true, false, true, false],
            },
            "",
          ],
          [
            {
              border: [true, false, false, true],
              text: "695009",
              fontSize: 18,
              alignment: "left",
              heights: 50,
            },
            {
              border: [false, false, true, false],
              text: "TRN/KPH",
              fontSize: 18,
              alignment: "right",
              bold: true,
            },
          ],
        ],
      },
    },
    {
      table: {
        heights: [40, 40],
        widths: [200, 200],
        body: [
          [
            {
              border: [true, false, false, false],
              text: [
                { text: "Shipping Address:", bold: true },
                { text: "\nTESTING", bold: true },
                {
                  text: "\nmy street\n",
                },
                { text: "test", bold: true },
              ],
              width: 200,
              alignment: "left",
            },
            {
              border: [true, true, true, false],
              text: [
                { text: "test", bold: true, alignment: "center", fontSize: 20 },
                {
                  text: "\n$4500.00",
                  bold: true,
                  alignment: "center",
                  fontSize: 20,
                },
                {
                  text: "\nSurface",
                  bold: true,
                  alignment: "center",
                  fontSize: 20,
                },
              ],
              width: 200,
              alignment: "left",
            },
          ],
        ],
      },
    },
    {
      table: {
        heights: [40, 40],
        widths: [200, 200],
        body: [
          [
            {
              border: [true, true, false, false],
              text: [
                {
                  text: "Seller:",
                  bold: false,
                  border: [false, false, false, false],
                },
                { text: "\test", bold: true },
                {
                  text: "\ntest",
                },
              ],
              width: 200,
              alignment: "left",
            },
            {
              text: "",
              border: [true, true, true, false],
            },
          ],
        ],
      },
    },
    {
      table: {
        heights: [20, 20, 20],
        widths: [130, 131, 130],
        body: [
          [
            {
              text: ["Product"],

              alignment: "center",
            },
            {
              text: ["Price"],

              alignment: "center",
            },
            {
              text: ["Total"],

              alignment: "center",
            },
          ],
          [
            {
              text: [{ text: "Apparels" }],

              alignment: "left",
            },
            {
              text: [{ text: "$4500.00" }],

              alignment: "center",
            },
            {
              text: [{ text: "$4500.00" }],

              alignment: "center",
            },
          ],
          [
            {
              text: ["Total"],

              alignment: "left",
            },
            {
              text: [{ text: "$4500.00", bold: true }],

              alignment: "center",
            },
            {
              text: [{ text: "$4500.00", bold: true }],

              alignment: "center",
            },
          ],
        ],
      },
    },
    {
      table: {
        heights: [80, 80],
        widths: [200, 200],
        body: [
          [
            {
              colSpan: 2,
              image: "",
              width: 200,
              alignment: "center",
              border: [true, false, true, true],
            },
            "",
          ],
        ],
      },
    },
    {
      table: {
        heights: [20, 20],
        widths: [200, 200],
        body: [
          [
            {
              colSpan: 2,
              text: "Return Address: test",
              width: 200,
              alignment: "left",
              border: [true, false, true, true],
            },
            "",
          ],
        ],
      },
    },
  ],
}
Created at 3 weeks ago
closed issue
Hiding row if value is false

Do we have a option to hide any element in the table if some value is false?

   const hasGstValue = pricing.cgst > 0;
       hasGstValue && 
        [
          {
            text: test,
            fontSize: test,
            margin: [0, 10, 0, 0],
            bold: true
          },
          
          {
            text: formatCurrency({
              price: 10,
              currencyLabel: "test "
            }),
            headlineLevel: headlineLevel.subtotal,
            alignment: "right",
            fontSize: test,
            margin: [0, 10, 0, 0]
          }
        ] : 
        
        

if it is true, it works perfectly. if false, it gives the below error. pdfmake.js:87940 Malformed table row false in node

 if (data === undefined) {
            console.error(
              "Malformed table row ",
              rowData,
              "in node ",
              node
            );
            throw "Malformed table row, a cell is undefined.";
                                
Created at 4 weeks ago
issue comment
Hiding row if value is false

This is correct, table row cannot be null. You can create table dynamically by Array.push to variable with table rows.

Created at 4 weeks ago
closed issue
pdfMake and two (maybe) specific pdf files -> preview shows blank page when both added to preview

oncotarget-08-3237-s001.pdf oncotarget-08-3237.pdf

Hello, recently I have encountered an issue with pdfMake while trying to show(print) using pdfMake thumbnails of the attached two pdf files, First I did thumbnails of both pdf files, then I have used some online image to base64 encoder to encode pdf files to create base64 images as an inputs for pdfMake and then something very strange appears....on pdfMake playground when I tried to add both files then pdfMake in preview shows blank page....when I will remove one file from code, then pdfMake preview works fine and one file is showed properly.

I have a question is there any limitation for pdfMake for file size of base64 image to show or something like this? In my code attachments which are attached to report which then later we are getting the base64 images from attachments which are then printed in report, whenever I have added both of these pdf files which I have provided, then pdfMake preview shows blak page, if I will add only one of the pdf files which I have provided you to try, then pdfMake preview worked fine.

Or maybe these two pdf files are somehow very specific and pdfMake has issues when they are both rendered/preview...this is also possible, if someone knows how to check these pdf files if maybe one of them is somehow corrupted, I would appreciate.

I have ask/favour to people who knows pdfMake or people who developed it or participate in development, can you check the attached files and try to preview both n pdfMake as { image: ....... } and check it, then let me know about some outcomes .... or maybe someone already knows the answer that maybe pdfMake has some limitations.

I can add that when opening preview from pdfMake in new browser tab or download pdf file, then everything is rendering just fine and both images are on pdf....only preview in iframe is not working properly and when both images are included then pdfMake is rendering blank page.

Thank you all very much for any help or advice or tips. Best regards

Created at 4 weeks ago
issue comment
Issue with 0.3. - beta 2 version in aws lambda

pdfmake has no request cache therefore it cannot be related to pdfmake. AWS lambda probably has some cache and that is causing this problem it needs to be turned off or reconfigured.

Created at 4 weeks ago
closed issue
Fonts Causing Issues in Vercel Deployment

Hi All,

I am generating a PDF on the server side then sending back to client. In localhost it works fine, once i deploy to Vercel (nextjs) I get an error.

Server Code:

      const fonts = {
        Roboto: {
          // Path relative to process.cwd()
          normal: 'src/pages/api/fonts/Roboto-Regular.ttf',
          italics: 'src/pages/api/fonts/Roboto-Italic.ttf',
          bold: 'src/pages/api/fonts/Roboto-Bold.ttf'
        }
      };

      const printer = new PdfPrinter(fonts);
      const docDefinition: TDocumentDefinitions = await generateDocDefinition(patient);
      const pdfDoc = printer.createPdfKitDocument(docDefinition);
      pdfDoc.pipe(BlobStream());
      pdfDoc.end();
      res.send(pdfDoc);

On Client:

const generatePDF = async (id: string) => {
  await apiClient
    .get(`/patient/generatePDF/${id}`, {
      responseType: 'blob'
    })
    .then((response) => {
      const file = new Blob([response.data], {
        type: 'application/pdf'
      });
      //Build a URL from the file
      const fileURL = URL.createObjectURL(file);
      //Open the URL on new Window
      window.open(fileURL);
    })
    .catch((error) => {
      console.log('Error: ' + error);
    });
};

In deploy environment it is hitting the catch block.

Created at 1 month ago