Recent

Author Topic: fpPDF -transparent fill shape & transparent font  (Read 1116 times)

jonyrh

  • New Member
  • *
  • Posts: 20
    • Jony Rh Homepage
fpPDF -transparent fill shape & transparent font
« on: February 19, 2022, 10:54:21 am »
Hello everyone, please tell me how to do transparent fill shape & transparent font in fpPDF?

tdb

  • New Member
  • *
  • Posts: 26
Re: fpPDF -transparent fill shape & transparent font
« Reply #1 on: October 07, 2024, 12:17:13 pm »
Hi Jonyrh,

Did you ever find an answer? 
I need to shade the lines in the PDF to make reports easier to read, I tried DrawRect but not working.
Anyway if you did find the answer could you possible share please :)

tdb

  • New Member
  • *
  • Posts: 26
Re: fpPDF -transparent fill shape & transparent font
« Reply #2 on: October 08, 2024, 08:53:19 am »
Just to update this in case anyone else needs a work around

Create a small .png graphics file and set page size to very small say 100x50 pixels fill the page with colour of you choice and ensure Opacity is set to say 30% then save the file e.g. LineColour.png in my case.

In your FPPDF module

// Add the image and store for future use
iPicIndex := oPdf.Images.AddFromFile('c:\myprog\art\LineColour.png', False);

// Use FPPDF function to paint the line (you can stretch by using whatever width and height you need.
DrawImage(fXpos, fYpos, fWidth, fHeight, iPicIndex);

Not the best solution as inflates the size of the PDF but it works.

 

TinyPortal © 2005-2018