コード例 #1
0
        public static Web2PDFResponse UrlToPDF(Web2PDFRequest req)
        {
            UrlToPdf4CS.PDFParamA parama = new UrlToPdf4CS.PDFParamA();
            parama.mbUrl        = req.WebURL;
            parama.mbPdfPath    = GetTempPDFFileName();
            parama.mbHeaderHtml = req.HeaderPath;
            parama.mbFooterHtml = req.FooterPath;

            Web2PDFResponse rsp = new Web2PDFResponse();

            rsp.PDFPath = parama.mbPdfPath;
            try
            {
                int nRet = UrlToPdf4CS.djhuUrlToPdfParamA(ref parama);

                if (nRet == 0)
                {
                    rsp.ErrorCode = 0;
                    rsp.ErrorInfo = "SUCCESS";
                }
                else
                {
                    rsp.ErrorCode = nRet;
                    rsp.ErrorInfo = "FAILED";
                }
            }
            catch (Exception ex)
            {
                Logger.LogEvent("", ex.Message);
            }

            return(rsp);
        }
コード例 #2
0
 public static void DeInitUrlTOPdf4CS()
 {
     lock (objLock)
     {
         if (bInited && !bDeInited)
         {
             UrlToPdf4CS.djhuPDFLibDeInit();
             bDeInited = true;
         }
     }
 }
コード例 #3
0
 public static void InitUrlTOPdf4CS()
 {
     lock (objLock)
     {
         if (!bInited && !bDeInited)
         {
             try
             {
                 UrlToPdf4CS.djhuPDFLibInit();
                 bInited = true;
             }
             catch (Exception ex)
             {
                 Logger.LogEvent("", ex.Message);
             }
         }
     }
 }