| // Temporary name of file which will be downloaded | // Temporary name of file which will be downloaded | ||||
| var fileName = Guid.NewGuid().ToString() + ".pdf"; | var fileName = Guid.NewGuid().ToString() + ".pdf"; | ||||
| // Path to wwwroot folder combined with name of pdf file | // 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); | // string path = Path.Combine(host.WebRootPath, fileName); | ||||
| // Generate PDF file in wwwroot | // Generate PDF file in wwwroot | ||||
| // Service obradjuje zahtev | // Service obradjuje zahtev |
| 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; |
| | |||||
| import PDFEngine from './pdfengine' | |||||
| (() => | (() => | ||||
| { | { | ||||
| document.write("Hello world"); | |||||
| PDFEngine(); | |||||
| })() | })() |
| # PDFEngineAPI | # 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 |