private void btnExportSingle_Click(object sender, EventArgs e)
        {
            if (qualificRound != null && dataGridView2.SelectedRows.Count > 0)
            {
                List <ComboBoxFlights> ctl = new List <ComboBoxFlights>();

                DataGridViewRow dgvr = dataGridView2.SelectedRows[0];
                {
                    FlightSet flt = dgvr.Tag as FlightSet;
                    if (flt.Point.Count > 0)  // skip flights without imported logger data
                    {
                        ComboBoxFlights cboFlt = new ComboBoxFlights(flt, new string[] { "--" });
                        ctl.Add(cboFlt);

                        String        dirPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + @"\AirNavigationRace\";
                        DirectoryInfo di      = Directory.CreateDirectory(dirPath);
                        if (!di.Exists)
                        {
                            di.Create();
                        }
                        PDFCreator.CreateResultPDF(visualisationPictureBox1, Client, qualificRound, ctl, dirPath +
                                                   @"\Results_" + cleanedString(qualificRound.Name) + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
                    }
                    else
                    {
                        MessageBox.Show("Logger data for the selected flight is missing. The MapSet will not be exported.", "Single MapSet Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// PDF作成時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnPDFCreateor_Click(object sender, EventArgs e)
        {
            //pdf作成処理
            PDFCreator.GetInstance().Init("result.pdf");

            string dayStr     = "";
            int    periodType = CbPeriod.SelectedIndex;

            switch (periodType)
            {
            case (int)PeriodType.Monthly:
                dayStr = DTPickerBreakdown.Value.ToString(AppConst.DTP_MONTH_TIMESTR);
                break;

            case (int)PeriodType.Year:
                dayStr = DTPickerBreakdown.Value.ToString(AppConst.DTP_YEAR_TIMESTR);
                break;

            case (int)PeriodType.Period:
                dayStr = DTPickerBreakdown.Value.ToString(AppConst.DTP_DAY_TIMESTR)
                         + "~" + DTPickerBreakdown02.Value.ToString(AppConst.DTP_DAY_TIMESTR);
                break;
            }

            string    classifStr = CbClassification.Text;
            string    periodStr  = CbPeriod.Text;
            DataTable dataTable  = MakeDataTable(statisticsLists);

            PDFCreator.GetInstance().Create(dayStr, classifStr, periodStr, dataTable, DateTime.Now.ToString("yyyyMMdd"));

            OriginMBox.MBoxInfoOK(AppConst.PDF_SUCCESS_MESSAGE);
        }
예제 #3
0
        private void PrintPrescriptionButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                using (var context = new DataBaseContext())
                {
                    var medicalWorker = context.Users.Include(x => x.MedicalWorker).Single(x => x.Id == DataHolderForMainWindow.User.Id).MedicalWorker;

                    string medicinesList         = "";
                    string medicinesPaymentsList = "";
                    foreach (var medicine in PrescriptionList)
                    {
                        medicinesList         += medicine.MedicinesName + " " + medicine.Dosage + "\n";
                        medicinesPaymentsList += "50\n";
                    }

                    PDFCreator.MakePrescription(new PrescriptionPDFRequiredData()
                    {
                        PacientName       = CurrentVisit.PatientsName,
                        PacientPESEL      = CurrentVisit.PatientsPESEL,
                        MedicalWorkerName = medicalWorker.FirstName + " " + medicalWorker.LastName,
                        Medicines         = medicinesList,
                        MedicinesPayment  = medicinesPaymentsList
                    });
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void btnExportAll_Click(object sender, EventArgs e)
 {
     if (qualificRound != null && dataGridView2.Rows.Count > 0)
     {
         List <ComboBoxFlights> ctl = new List <ComboBoxFlights>();
         foreach (DataGridViewRow dgvr in dataGridView2.Rows)
         {
             FlightSet flt = dgvr.Tag as FlightSet;
             if (flt.Point.Count == 0)  // skip flights without imported logger data
             {
                 continue;
             }
             ComboBoxFlights cboFlt = new ComboBoxFlights(flt, new string[] { "--" });
             ctl.Add(cboFlt);
         }
         String        dirPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + @"\AirNavigationRace\";
         DirectoryInfo di      = Directory.CreateDirectory(dirPath);
         if (!di.Exists)
         {
             di.Create();
         }
         PDFCreator.CreateResultPDF(visualisationPictureBox1, Client, qualificRound, ctl, dirPath +
                                    @"\Results_" + cleanedString(qualificRound.Name) + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
     }
 }
예제 #5
0
        public Form1()
        {
            InitializeComponent();
            m_ImageCore = new ImageCore();
            dsViewer1.Bind(m_ImageCore);
            m_Rasterizer = new PDFRasterizer(m_StrProductKey);
            m_Creator    = new PDFCreator(m_StrProductKey);
            toolStripCbxPen.SelectedIndex  = 0;
            toolStripCbxFont.SelectedIndex = 0;

            dsViewer1.Annotation.Type = Dynamsoft.Forms.Enums.EnumAnnotationType.enumPointer;
            dsViewer1.SetViewMode(1, 1);

            string imagePath = Application.ExecutablePath;

            imagePath = imagePath.Replace("/", "\\");
            string strDllFolder = imagePath;
            int    pos          = imagePath.LastIndexOf("\\Samples\\");

            if (pos != -1)
            {
                imagePath = imagePath.Substring(0, imagePath.IndexOf(@"\", pos)) + @"\Samples\Bin\Images\AnnotationImage\Annotation Sample Image.png";
            }
            else
            {
                imagePath = Application.StartupPath + @"\Bin\Images\AnnotationImage\Annotation Sample Image.png";
            }
            m_ImageCore.IO.LoadImage(imagePath);

            dsViewer1.Annotation.OnAnnotationTextChanged += Annotation_OnAnnotationTextChanged;
            dsViewer1.Annotation.OnAnnotationSelected    += Annotation_OnAnnotationSelected;
            dsViewer1.Annotation.OnAnnotationDeselected  += Annotation_OnAnnotationDeselected;
        }
예제 #6
0
        static void Main()
        {
            var vendors  = DAOMySQL.GetVendors();
            var measures = DAOMySQL.GetMeasures();
            var products = DAOMySQL.GetData();

            DAOMsSQL.SetData(vendors, measures, products);

            ExcelReader.MyExtract();
            List <List <SaleInfo> > sales = ExcelReader.ReadAllExcells();

            DAOMsSQL.SetDataFromXls(sales); //1va

            PDFCreator.CreatePDF();         //2ra

            List <XMLReportInfo> info = DAOMsSQL.XMLPersiter();

            XMLReader.GenerateSalesReportXMLByVendor(info); //3ta
            XMLReader.GenerateSalesReportXMLMontly(info);   //5ta


            MongoWorker.SaveData();//4ta

            //SQLITE.GenerateTaxes();
            //SQLITE.FillSQLITEProducts();
            // SQLITE.FillExcelFile();
        }
예제 #7
0
        public void CreateAndMergePDFsFromSection1Test()
        {
            ExcelReader er_ = new ExcelReader(@"C:\Users\juntunenkc\Desktop\pdf test\Section 1.xlsx",
                                              ExcelReader.ExcelReaderExtensionOptions.SLDDRW,
                                              ExcelReader.ExcelReaderSearchOptions.THIS_DIR);
            var      ll_    = er_.ReadFile();
            SldWorks swApp_ = null;

            try {
                swApp_ = System.Runtime.InteropServices.Marshal.GetActiveObject(@"SldWorks.Application." + v++) as SldWorks;
            } catch (System.Runtime.InteropServices.COMException e) {
                System.Console.WriteLine(e.Message);
            }
            PDFCreator p = new PDFCreator();

            p.CreateDrawings(swApp_, ll_);

            var nd_ = ll_.First;

            while (nd_ != null)
            {
                nd_.Value.fileInfo = new FileInfo(nd_.Value.fileInfo.FullName.Replace(@".SLDDRW", @".PDF"));
                nd_ = nd_.Next;
            }
            System.Runtime.InteropServices.Marshal.ReleaseComObject(swApp_);
            PDFCreator.Merge(ll_, new FileInfo(@"C:\Users\juntunenkc\Desktop\pdf test\test.pdf"));
        }
예제 #8
0
        public BestelbonOpmaakViewModel(IEventAggregator eventAggregator, IWindowManager windowsmanager,
                                        Bestelbon bestelbon, PDFCreator pDFCreator)
        {
            _eventAggregator = eventAggregator;
            _windowManager   = windowsmanager;
            _eventAggregator.Subscribe(this);
            _bestelbon            = bestelbon;
            _pdfCreator           = pDFCreator;
            this.Leverancier      = new Leverancier();
            LeveranciersNaamUI    = "";
            Opmerking             = "Te vermelden bij communicatie : ";
            NewEenheid            = "stuk";
            Bestelbon.Leverancier = new Leverancier();
            Bestelbonregels       = Bestelbon.Bestelbonregels;
            Totaal = Bestelbon.TotalPrice;
            Bestelbon.OnTotalPriceChanged += BerekenPrijs;
            NewAantal        = 1;
            NewPrijsstring   = "0.0";
            BestelbonNaam    = "";
            this.CurrentUser = new User();

            //String levvw = "1. Maximum hefvermogen beschikbare heftruck = 2.5 ton hefhoogte = 3m";
            //var FilePath = Properties.Settings.Default.Leveringsvw;
            //var serializer = new XmlSerializer(typeof(String));
            //using (var writer = new System.IO.StreamWriter(FilePath))
            //{
            //    serializer.Serialize(writer, levvw);
            //    writer.Flush();
            //}
        }
예제 #9
0
 /// <summary>
 /// Initialize and loading configuration.
 /// </summary>
 public FrmTest()
 {
     InitializeComponent();
     m_oPiLibrary          = new PDFCreator();
     m_oPiWebService       = new PDFCreatorWebServiceSoapClient();
     m_strPiSampleFileName = string.Empty;
     m_oPiConfig           = SSGConfigFactory.GetConfig();
 }
예제 #10
0
        public void FilesNotFoundTest()
        {
            ExcelReader er_ = new ExcelReader(new FileInfo(@"G:\ZALES\FIXTURE BOOK\SECTIONS\SECTION 1\Section 1.xlsx"),
                                              ExcelReader.ExcelReaderExtensionOptions.PDF, ExcelReader.ExcelReaderSearchOptions.THIS_DIR);
            var ll_ = er_.ReadFile();

            PDFCreator.Merge(ll_, new FileInfo(@"C:\Users\juntunenkc\Desktop\pdf test\test.pdf"));
        }
예제 #11
0
        public void MergePDFsFromSection1Test()
        {
            ExcelReader er_ = new ExcelReader(@"C:\Users\juntunenkc\Desktop\pdf test\Section 1.xlsx",
                                              ExcelReader.ExcelReaderExtensionOptions.PDF, ExcelReader.ExcelReaderSearchOptions.THIS_DIR);
            var ll_ = er_.ReadFile();

            PDFCreator.Merge(ll_, new FileInfo(@"C:\Users\juntunenkc\Desktop\pdf test\test1.pdf"));
        }
예제 #12
0
        static void Main(string[] args)
        {
            //PDFCreator.DemoTableSpacing();
            //return;
            //PDFCreator.CreatePdf();
            List <TransactionDetail> transactionDetails = new List <TransactionDetail>();
            string conString = @"Data Source=JAYANTGURU-PC\SQLSERVER2017;Initial Catalog=Practice;Persist Security Info=True;User ID=sa;Password=guru@000";

            using (SqlConnection sqlConn = new SqlConnection(conString))
            {
                sqlConn.Open();
                using (SqlCommand sqlCmd = new SqlCommand(@"SELECT FolioNumber
                                                                    ,ClientCode
                                                                    ,ClientName
                                                                    ,SchemeName
                                                                    ,AMCName
                                                                    ,AssetClass
                                                                    ,Category
                                                                    ,TransactionType
                                                                    ,SubType
                                                                    ,TransactionDate
                                                                    ,TransactionNumber
                                                                    ,Units
                                                                    ,Price
                                                                    ,Amount
                                                                   FROM [Practice].[dbo].[TransactionDetail]", sqlConn))
                {
                    using (SqlDataReader sqlReader = sqlCmd.ExecuteReader())
                    {
                        // get the data and fill rows 5 onwards
                        while (sqlReader.Read())
                        {
                            TransactionDetail transactionDetail = new TransactionDetail();
                            transactionDetail.FolioNumber       = sqlReader["FolioNumber"] != DBNull.Value ? Convert.ToInt64(sqlReader["FolioNumber"]) : 0;
                            transactionDetail.ClientCode        = sqlReader["ClientCode"] != DBNull.Value ? sqlReader["ClientCode"].ToString() : string.Empty;
                            transactionDetail.ClientName        = sqlReader["ClientName"] != DBNull.Value ? sqlReader["ClientName"].ToString() : string.Empty;
                            transactionDetail.SchemeName        = sqlReader["SchemeName"] != DBNull.Value ? sqlReader["SchemeName"].ToString() : string.Empty;
                            transactionDetail.AMCName           = sqlReader["AMCName"] != DBNull.Value ? sqlReader["AMCName"].ToString() : string.Empty;
                            transactionDetail.AssetClass        = sqlReader["AssetClass"] != DBNull.Value ? sqlReader["AssetClass"].ToString() : string.Empty;
                            transactionDetail.Category          = sqlReader["Category"] != DBNull.Value ? sqlReader["Category"].ToString() : string.Empty;
                            transactionDetail.TransactionType   = sqlReader["TransactionType"] != DBNull.Value ? sqlReader["TransactionType"].ToString() : string.Empty;
                            transactionDetail.SubType           = sqlReader["SubType"] != DBNull.Value ? sqlReader["SubType"].ToString() : string.Empty;
                            transactionDetail.TransactionDate   = sqlReader["TransactionDate"] != DBNull.Value ? sqlReader["TransactionDate"].ToString() : string.Empty;
                            transactionDetail.TransactionNumber = sqlReader["TransactionNumber"] != DBNull.Value ? Convert.ToInt64(sqlReader["TransactionNumber"]) : 0;
                            transactionDetail.Units             = sqlReader["Units"] != DBNull.Value ? float.Parse(sqlReader["Units"].ToString()) : 0;
                            transactionDetail.Price             = sqlReader["Price"] != DBNull.Value ? float.Parse(sqlReader["Price"].ToString()) : 0;
                            transactionDetail.Amount            = sqlReader["Amount"] != DBNull.Value ? float.Parse(sqlReader["Amount"].ToString()) : 0;
                            transactionDetails.Add(transactionDetail);
                        }
                        sqlReader.Close();
                    }
                }
                sqlConn.Close();
            }
            DataTable dataTable = Utils.ToDataTable(transactionDetails);

            PDFCreator.Create(dataTable, @"D:\Work\Projects\DotNet\PracticeProjects\ExportToPDFTest\ExportToPDFTest\Pdfs\TransPDFdocument.pdf");
        }
예제 #13
0
 public Form1()
 {
     InitializeComponent();
     Initialization();
     m_ImageCore = new ImageCore();
     dsViewer1.Bind(m_ImageCore);
     m_TwainManager = new TwainManager(m_StrProductKey);
     m_PDFCreator   = new PDFCreator(m_StrProductKey);
 }
예제 #14
0
        static private PDFCreator oPiPDFCreator;           // object library

        #endregion

        #region Contructor

        /// <summary>
        /// Initialize and loading configuration
        /// </summary>
        public PDFCreatorService()
        {
            InitializeComponent();
            // Load configuration file from execution path
            oPiConfig     = SSGConfigFactory.GetConfig(GetConfigFile());
            oPiPDFCreator = new PDFCreator();
            ePiState      = ProcessState.IDLE_STATE;
            Logger.WriteLog("PDF Generator Service has initialized...");
        }
예제 #15
0
        public async Task <byte[]> DecesionCreatePDFAsyncForFood(FoodcourtCheck pdfData)
        {
            IPDFSettings pdfSettings = new PDFSettings()
            {
                Title = string.Format("Check")
            };
            IPDFCreator creator = new PDFCreator(new FoodCheck(pdfData, pdfSettings));

            return(await Task.Run(() => creator.GetPDFBytes()));
        }
예제 #16
0
        public ActionResult PDF(string json)
        {
            MapExportItem exportItem = JsonConvert.DeserializeObject <MapExportItem>(json);

            AsyncManager.OutstandingOperations.Increment();
            PDFCreator pdfCreator = new PDFCreator();

            byte[] blob = pdfCreator.Create(exportItem);
            return(File(blob, "application/pdf", "kartutskrift.pdf"));
        }
예제 #17
0
 public MemoryStream CreatePDF(Team teamToPrint)
 {
     try
     {
         return(PDFCreator.CreatePDF(db.Students.Include("Team").Include("Credentials").Where(x => x.Team.TeamId == teamToPrint.TeamId).ToArray()));
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #18
0
 /// <summary>
 /// PDF作成後に印刷プレビュー画面表示
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnPrint_Click(object sender, EventArgs e)
 {
     if (OriginMBox.MBoxInfoYesNo(AppConst.PDF_INSTALL_MESSAGE) == DialogResult.Yes)
     {
         PDFCreator.GetInstance().Preview(true, PDFCreator.GetPDFFile(DateTime.Now.ToString("yyyyMMdd")));
     }
     else
     {
         PDFCreator.GetInstance().Preview(false, PDFCreator.GetPDFFile(DateTime.Now.ToString("yyyyMMdd")));
     }
 }
예제 #19
0
        public Form1()
        {
            InitializeComponent();
            m_ImageCore = new ImageCore();
            dsViewer1.Bind(m_ImageCore);

            Initialization();
            m_Generator     = new Dynamsoft.Barcode.BarcodeGenerator(m_StrProductKey);
            m_PDFCreator    = new PDFCreator(m_StrProductKey);
            m_PDFRasterizer = new PDFRasterizer(m_StrProductKey);
        }
        private void btnExport_Click(object sender, EventArgs e)
        {
            String        dirPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + @"\AirNavigationRace\";
            DirectoryInfo di      = Directory.CreateDirectory(dirPath);

            if (!di.Exists)
            {
                di.Create();
            }
            PDFCreator.CreateTeamsPDF(Client.SelectedCompetition.TeamSet.ToList(), Client, dirPath +
                                      @"\CrewsPrintout_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
        }
예제 #21
0
 public Form1()
 {
     InitializeComponent();
     Initialization();
     m_PDFRasteizer = new Dynamsoft.PDF.PDFRasterizer(m_StrProductKey);
     m_PDFCreator   = new PDFCreator(m_StrProductKey);
     m_ImageCore    = new ImageCore();
     dsViewer1.Bind(m_ImageCore);
     chbMultiPagePDF.Checked  = false;
     chbMultiPagePDF.Enabled  = false;
     chbMultiPageTIFF.Checked = false;
     chbMultiPageTIFF.Enabled = false;
 }
예제 #22
0
        public string PDF(string json)
        {
            MapExportItem exportItem = JsonConvert.DeserializeObject <MapExportItem>(json);

            AsyncManager.OutstandingOperations.Increment();
            PDFCreator pdfCreator = new PDFCreator();

            byte[]   blob     = pdfCreator.Create(exportItem);
            string[] fileInfo = byteArrayToFileInfo(blob, "pdf");

            return(Request.Url.GetLeftPart(UriPartial.Authority) + "/Temp/" + fileInfo[1]);
            //return File(blob, "application/pdf", "kartutskrift.pdf");
        }
예제 #23
0
 /// <summary>
 /// Do process for calling the SSG.PDFReceive.PDFCreator.PerfromGeneratePDF
 /// </summary>
 /// <param name="strWorker">The name of Worker</param>
 /// <param name="oID">The ID of requested pdf generate.</param>
 /// <param name="bForce">Force generate a pdf</param>
 /// <seealso cref="SSG.PDF.PDFCreator.PerfromGeneratePDF"/>
 public void DoProcess(string strWorker, Guid oID, bool bForce)
 {
     try
     {
         // Calling a PerfromGeneratePDF with Woker name and requested id.
         oPiPDFCreator = new PDFCreator();
         oPiPDFCreator.PerfromGeneratePDF(strWorker, oID, bForce);
     }
     catch (Exception ex)
     {
         // Write error log.
         Logger.WriteLog(ex);
     }
 }
예제 #24
0
        private async void GeneratePDFAsync(ExportModel item)
        {
            var pdfID = item.JobID;
            var job   = _context.GetSpecificJobAsync(pdfID);

            PDFCreator pdfnew = new PDFCreator();
            var        stream = pdfnew.testc();



            await SaveAndView($"PDF_{item.FileName}_{item.ID}.pdf", "application / pdf", stream);

            await DisplayAlert("Notification", "PDF Export has been created.", "OK");
        }
예제 #25
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //Get the selected Row
            int currentRowIndex = Convert.ToInt32(e.CommandArgument);
            //GridViewRow row = GridView1.Rows[currentRowIndex];

            //Get the DataKey names for the selected row
            int reportId = int.Parse(this.GridView1.DataKeys[currentRowIndex].Values["partner_report_id"].ToString());

            if (e.CommandName == "pdf")
            {
                PDFCreator pdf = new PDFCreator();
                pdf.createPDF(reportId);
            }
        }
        private void ExportResultRanking(bool exportAsPdf = true)
        {
            if (qualificRound != null && dataGridView2.Rows.Count > 0)
            {
                List <FlightSet>       lstFlt = new List <FlightSet>();
                List <ComboBoxFlights> ctl    = new List <ComboBoxFlights>();

                foreach (DataGridViewRow dgvr in dataGridView2.Rows)
                {
                    FlightSet flt = dgvr.Tag as FlightSet;
                    if (flt.Point.Count > 0)
                    {
                        ComboBoxFlights cboFlt = new ComboBoxFlights(flt, new string[] { "--" });
                        ctl.Add(cboFlt);
                    }
                }

                String        dirPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + @"\AirNavigationRace\";
                DirectoryInfo di      = Directory.CreateDirectory(dirPath);
                if (!di.Exists)
                {
                    di.Create();
                }

                if (exportAsPdf)
                {
                    PDFCreator.CreateRankingListPDF(Client, qualificRound, ctl, dirPath +
                                                    @"\Results_" + cleanedString(qualificRound.Name) + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".pdf");
                }
                else
                {
                    using (SaveFileDialog sfd = new SaveFileDialog())
                    {
                        string _fileFilter = "Excel Files (*.xls, *.xlsx)|*.xls;*.xlsx| Csv files (*.csv)|*.csv| All files (*.*)|*.*";

                        sfd.FileName        = @"\Results_" + cleanedString(qualificRound.Name) + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx";
                        sfd.Filter          = _fileFilter;
                        sfd.FilterIndex     = 0;
                        sfd.OverwritePrompt = true;
                        if (sfd.ShowDialog() == DialogResult.OK)
                        {
                            OpenOfficeCreator.CreateRankingListExcel(Client.SelectedCompetition.Name, qualificRound.Name, ctl, sfd.FileName);
                            MessageBox.Show("Ranking list saved", "Ranking list saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
        }
        private void btnExportToPDF_Click(object sender, EventArgs e)
        {
            QualificationRoundSet c = textName.Tag as QualificationRoundSet;

            if (c != null)
            {
                String        dirPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) + @"\AirNavigationRace\";
                DirectoryInfo di      = Directory.CreateDirectory(dirPath);
                if (!di.Exists)
                {
                    di.Create();
                }
                PDFCreator.CreateStartListPDF(c, Client, dirPath +
                                              @"\StartList_" + c.Id + "_" + c.Name + "_" + DateTime.UtcNow.ToString("yyyyMMddhhmmss") + ".pdf");
            }
        }
예제 #28
0
 private void CreateDoctorsReferalButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         PDFCreator.MakeRefferal(new RefferalPDFRequiredData()
         {
             PacientName  = CurrentVisit.PatientsName,
             PacientPESEL = CurrentVisit.PatientsPESEL,
             PacientAge   = CurrentVisit.PatientsAge,
             Sickness     = DiagnosedSicknessTextBox.Text
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #29
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //Get the selected Row
            int currentRowIndex = Convert.ToInt32(e.CommandArgument);
            //GridViewRow row = GridView1.Rows[currentRowIndex];

            //Get the DataKey names for the selected row
            int reportId = int.Parse(this.GridView1.DataKeys[currentRowIndex].Values["partner_report_id"].ToString());

            if (e.CommandName == "Edit")
            {
                Response.Redirect(String.Format("~/Pillar/PillarReport.aspx?reportID={0}", reportId));
            }
            else if (e.CommandName == "pdf")
            {
                PDFCreator pdf = new PDFCreator();
                pdf.createPDF(reportId);
            }
        }
예제 #30
0
        public string PDF(string json)
        {
            try
            {
                _log.DebugFormat("Received json: {0}", json);

                // try to decode input string to see if it is base64 encoded
                try
                {
                    byte[] decoded = Convert.FromBase64String(json);
                    json = System.Text.Encoding.UTF8.GetString(decoded);
                    _log.DebugFormat("json after decode: {0}", json);
                }
                catch (Exception e)
                {
                    _log.DebugFormat("Could not decode base64. Will treat as non-base64 encoded: {0}", e.Message);
                }

                MapExportItem exportItem = JsonConvert.DeserializeObject <MapExportItem>(json);
                AsyncManager.OutstandingOperations.Increment();
                PDFCreator pdfCreator = new PDFCreator();
                _log.Debug("Inited pdfcreator");
                byte[] blob = pdfCreator.Create(exportItem);
                _log.Debug("created blob in pdfcreator");
                string[] fileInfo = byteArrayToFileInfo(blob, "pdf");
                _log.DebugFormat("Created fileinfo: {0}", fileInfo[1]);

                if (exportItem.proxyUrl != "")
                {
                    return(exportItem.proxyUrl + "/Temp/" + fileInfo[1]);
                }
                else
                {
                    return(Request.Url.GetLeftPart(UriPartial.Authority) + "/Temp/" + fileInfo[1]);
                }
                //return File(blob, "application/pdf", "kartutskrift.pdf");
            }
            catch (Exception e)
            {
                _log.ErrorFormat("Unable to create PDF: {0}", e.Message);
                throw e;
            }
        }
예제 #31
0
 static Manager()
 {
     Current = new PDFCreator(new HandlebarsHtmlContentProvider(),new DefaultConfigurationProvider());
 }