bradsec/pdfmerge

Filename on page if image

Closed this issue · 2 comments

Hey, nice job! This is exactly what we need for a classroom project.

When adding an image, the image filename is shown above the image. How to remove the filename?

Looking at pdfmerge.js, not real clear what to modify. Your input appreciated.

I'm going to add a toggle option for the filename text. At the moment just comment out the call to the drawWrappedText funcftion within the convertToPDF function. These lines -

        // Set a preferred font size and maximum text width
        const fontSize = 12;
        const maxTextWidth = rightMargin - leftMargin;

        // Calculate the position to draw the text at the top of the page
        const textX = leftMargin;
        const textY = pageHeight - 35;

        // Draw the text
        drawWrappedText(
          page,
          fileName,
          textX,
          textY,
          maxTextWidth,
          fontSize,
          customFont,
          fontSize,
          "#000000"
        );

Thank you for reply.

That did the trick, appreciate it.