thank you for your very quick Reply. Your sample works fine.
But I have the Image stored in a database and I want to retrieve via xdata.
First is a BLOB and you can see it using https://salelite.com/cadiaserver/xdata/AuftragUnterschriften('O19.00001')/UnterschriftMonteur Second is a Textfield holding the base64image https://salelite.com/cadiaserver/xdata/AuftragUnterschriften('O19.00001')/UnterschriftMonteurText
Both show fine putting the url to any browser, you can try it, it's my testing-environment.
If I add them to the container using TMSFNCBitmapContainer1.AddFromURL('https://salelite.com/cadiaserver/xdata/AuftragUnterschriften(''O19.00001'')/UnterschriftMonteur','layer3'); or TMSFNCBitmapContainer1.AddFromURL('https://salelite.com/cadiaserver/xdata/AuftragUnterschriften(''O19.00001'')/UnterschriftMonteurText','layer3'); No error is raised
If I then try to add it to the pdf pdf.graphics.drawimagewithname('layer3', PointF(100,200)); I get the following error ERROR Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. | stack::Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at getBase64Image (http://localhost:8000/PDFExportSample/PDFExportSample.js:48995:32) at GetBase64Image (http://localhost:8000/PDFExportSample/PDFExportSample.js:48998:13) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:49005:15) at Object.cb (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:41484:46) at Object.DrawImage$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44153:22) at Object.DrawImageWithName$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44143:95) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:44125:27) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:564:38) at Object.WebButton1Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:53427:38) Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at getBase64Image (http://localhost:8000/PDFExportSample/PDFExportSample.js:48995:32) at GetBase64Image (http://localhost:8000/PDFExportSample/PDFExportSample.js:48998:13) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:49005:15) at Object.cb (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:41484:46) at Object.DrawImage$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44153:22) at Object.DrawImageWithName$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44143:95) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:44125:27) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:564:38) at Object.WebButton1Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:53427:38) at http://localhost:8000/PDFExportSample/PDFExportSample.js [48995:32]
or ERROR Uncaught InvalidCharacterError: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. | stack::Error: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:49006:38) at Object.cb (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:41484:46) at Object.DrawImage$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44153:22) at Object.DrawImageWithName$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44143:95) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:44125:27) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:564:38) at Object.WebButton1Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:53427:38) at Object.cb [as FOnClick] (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:13978:58) Error: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:49006:38) at Object.cb (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.NotifyBitmap (http://localhost:8000/PDFExportSample/PDFExportSample.js:41484:46) at Object.DrawImage$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44153:22) at Object.DrawImageWithName$1 (http://localhost:8000/PDFExportSample/PDFExportSample.js:44143:95) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:44125:27) at Object.DrawImageWithName (http://localhost:8000/PDFExportSample/PDFExportSample.js:564:38) at Object.WebButton1Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:53427:38) at Object.cb [as FOnClick] (http://localhost:8000/PDFExportSample/PDFExportSample.js:222:26) at Object.Click (http://localhost:8000/PDFExportSample/PDFExportSample.js:13978:58) at http://localhost:8000/PDFExportSample/PDFExportSample.js [49006:38]
I don't know, what I'm doing wrong, would be very nice, if you could help me Thanks Stefan
Not necessarely, you need to make sure that the images are available at the domain where the PDF is generated, you could accomplish this by doing an HTTPRequest to "transfer" the images to the server where the web application is running.