| @@ -25,7 +25,7 @@ namespace BlackRock.Reporting.API.Controllers | |||
| // Temporary name of file which will be downloaded | |||
| var fileName = Guid.NewGuid().ToString() + ".pdf"; | |||
| // Path to wwwroot folder combined with name of pdf file | |||
| string path = Path.Combine(host.ContentRootPath, fileName); | |||
| string path = Path.Combine(host.ContentRootPath, $"wwwroot/pdfs/{fileName}"); | |||
| // string path = Path.Combine(host.WebRootPath, fileName); | |||
| // Generate PDF file in wwwroot | |||
| // Service obradjuje zahtev | |||
| @@ -0,0 +1,25 @@ | |||
| const initialize = () => { | |||
| document.getElementsByTagName('canvas').forEach(element => element.setAttribute('map','map1')); | |||
| document.getElementsByClassName("col-sm-6").forEach(e => e.setAttribute("mapiranje", "map1")); | |||
| const paragraf = document.createElement('p'); | |||
| paragraf.innerHTML = "hajde radi opet"; | |||
| document.querySelector('body').appendChild(paragraf); | |||
| } | |||
| const transform = () => { | |||
| document.querySelectorAll('[map="map1"]')[1].style.display = "none"; | |||
| let maliDivovi = document.querySelectorAll('[mapiranje="map1"]'); | |||
| maliDivovi.forEach(el => { el.className = "col-sm-12" }); | |||
| let p = document.createElement('p'); | |||
| p.innerHTML = 'mozda radi'; | |||
| document.querySelector('body').appendChild(p); | |||
| document.querySelector('body').style.backgroundColor = 'red'; | |||
| } | |||
| const PDFEngine = () => | |||
| { | |||
| initialize(); | |||
| transform(); | |||
| } | |||
| export default PDFEngine; | |||
| @@ -1,5 +1,5 @@ | |||
| | |||
| import PDFEngine from './pdfengine' | |||
| (() => | |||
| { | |||
| document.write("Hello world"); | |||
| PDFEngine(); | |||
| })() | |||
| @@ -1,2 +1,11 @@ | |||
| # PDFEngineAPI | |||
| First you download coreui free template ReactJS app from Drive (https://drive.google.com/file/d/16bRt2MTkg8b6cHLPtM_EzcF7H6raYz91/view) | |||
| Then extract it and open in command prompt | |||
| run: npm install | |||
| run: npm start | |||
| After it you can open BlackRock.Reporting.API project in command prompt | |||
| run: dotnet run and open https link | |||
| # NOTE: you must install .NET 6 SDK before starting API | |||
| # The first launch will take a little longer | |||