ExeOutput + PHP + PDF

I wrote a program in PHP to manage my shop and almost everything works.
For each article I generate an EAN13 barcode with FPDF which I store in the ./temp directory naming it barcode.pdf
Then I open the aforementioned PDF to be able to print it in a popup window or in embed mode (tried both) and so far so good.
When I go to insert a new article and therefore generate a new barcode, when printing, however, I see the PDF of the previous barcode, as if the ExeOutput or browser cache was always read instead of reloading the new file.
Online just press CTRL+F5 and the page reloads, but offline?
I don’t know where to turn my head anymore.
Any suggestions?
Thanks in advance.

I’d suggest using some random filename for your PDF file.

1 Like

Without seeing how you generate your PDF filename, shot in the dark here. I have had similar problems with all kinds of files over the years getting “cached” somewhere in the pipe.

I use something like this to generate filenames:

// Get the current Unix timestamp
$timestamp = time();

// Format the timestamp as desired
$formattedTimestamp = date('Y-m-d_H-i-s');

// Construct the file name
$fileName = "mypdf-$formattedTimestamp.pdf";
1 Like

Thank You.