I Put the .dll in the gac on the server
And use it like every .dll
It is ok?
I do:
My Class
Xrm.PDFCreator inst = Xrm.PDFCreator.Instance;
Common.RequestPdfCreateor req = new Common.RequestPdfCreateor();
Common.ResponsePdfCreateor res = inst.ConvertDocListToPdfFromFile(req, “”, “”, “pdf”);
PDFCreator Class
public sealed class PDFCreator
{
private PDFCreator()
{
// used only for local mechine
pdftron.PDFNet.Initialize(“Our Initialize”);
if (!pdftron.PDF.Convert.Printer.IsInstalled())
pdftron.PDF.Convert.Printer.Install();
}
public static PDFCreator Instance { get { return Nested.instance; } }
private class Nested
{
// Explicit static constructor to tell C# compiler
// not to mark type as beforefieldinit
static Nested()
{
}
internal static readonly PDFCreator instance = new PDFCreator();
}
public ResponsePdfCreateor ConvertDocListToPdfFromFile(RequestPdfCreateor request, string inPath, string outPath, string format = “pdf”)
{
var res = new ResponsePdfCreateor();
string file = @"\crm2016fulldev4\DocPreview\090bc034804241a5.docm";
List files = new List();
files.Add(file);
request = new RequestPdfCreateor { FullInputPathList = files };
var pdfdoc = new PDFDoc();
if (format == “pdf”)
{
foreach (var path in request.FullInputPathList)
{
try
{
pdftron.PDF.Convert.ToPdf(pdfdoc, path);
}
catch (PDFNetException e)
{
}
}
using (var ms = new MemoryStream())
{
pdfdoc.Save(ms, SDFDoc.SaveOptions.e_linearized);//.e_remove_unused);
pdfdoc.Close();
pdfdoc = null;
res.Data = ms.ToArray();
}
}
}
return res;
}
}
בתאריך יום א׳, 13 בספט׳ 2020 ב-9:55 מאת Tehila Horvitz <hstehilaeli@gmail.com>: