OK merge pdf!!! aggiunti pdf di esempio x test merge...

This commit is contained in:
Samuele E. Locatelli
2019-11-26 19:03:06 +01:00
parent e0b4fa0dcd
commit 6d2a4cd017
22 changed files with 124 additions and 51 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+32 -10
View File
@@ -1,5 +1,7 @@
using SteamWare;
using CMS_SC_Data;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Web.UI;
namespace CMS_SC
@@ -12,7 +14,10 @@ namespace CMS_SC
{
ddlFase.DataBind();
ddlLingue.DataBind();
idxDossier = memLayer.ML.QSS("IdxDossier");
string _idxDossier = memLayer.ML.QSS("IdxDossier");
int idxReq = 0;
int.TryParse(_idxDossier, out idxReq);
idxDossier = idxReq;
// se c'è seleziono fase...
ddlFase.SelectedValue = memLayer.ML.QSS("Fase");
// fix x revisione...
@@ -27,15 +32,17 @@ namespace CMS_SC
/// <summary>
/// Valore dossier salvato nell'hidden input
/// </summary>
string idxDossier
protected int idxDossier
{
get
{
return hfIdxDossier.Value;
int answ = 0;
int.TryParse(hfIdxDossier.Value, out answ);
return answ;
}
set
{
hfIdxDossier.Value = value;
hfIdxDossier.Value = value.ToString();
}
}
/// <summary>
@@ -98,18 +105,33 @@ namespace CMS_SC
// effettua merge Report Completo + allegati
// step 1: genera directory lavoro
string currPath = $"\\tmp\\{idxDossier}";
fileMover.obj.setDirectoryMapPath(currPath);
string currOutPath = $"\\tmp\\{idxDossier}";
fileMover.obj.setDirectoryMapPath(currOutPath);
fileMover.obj.checkDir();
// step 2: esporta pdf collaudo in dir temporanea
// path scehde!
string urlSchede = memLayer.ML.CRS("urlSchede");
string pdfInFullPath = "";
// step 2: esporta pdf collaudo in dir temporanea !!!FARE!!!
// step 3: colleziona allegati schede e li copia in locale
var tabDati = DtProxy.man.taASC.getByDossier(idxDossier);
List<string> elencoPdf = new List<string>();
foreach (var item in tabDati)
{
pdfInFullPath = "";
if (!elencoPdf.Contains(item.Path))
{
pdfInFullPath = Server.MapPath(string.Format(urlSchede, item.Path));
elencoPdf.Add(pdfInFullPath);
}
}
// step 4: MERGE di tutti i pdf nell'output
string outFile = $"{Server.MapPath(currOutPath)}\\FULL_{idxDossier}.pdf";
pdfUtils.mergePdfFiles(outFile, elencoPdf);
// step 5 cancellazione documenti collezionati
// step 6: rimanda a pagina x download nuovo file composto...
}
}
}