瀏覽代碼

Implement PDFEngine module in API

Feature
Safet Purkovic 4 年之前
父節點
當前提交
de5086fc68

+ 0
- 0
BlackRock.Reporting.API/38104c10-3062-4cf7-9fc3-47520992c662.pdf 查看文件


+ 1
- 1
BlackRock.Reporting.API/Controllers/PDFGeneratorController.cs 查看文件

@@ -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

+ 25
- 0
BlackRock.Reporting.API/PDFEngine.js 查看文件

@@ -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;

+ 2
- 2
BlackRock.Reporting.API/index.js 查看文件

@@ -1,5 +1,5 @@

import PDFEngine from './pdfengine'
(() =>
{
document.write("Hello world");
PDFEngine();
})()

+ 9
- 0
README.md 查看文件

@@ -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

Loading…
取消
儲存