/// <summary>
        /// Prints the a3 temperatur curve.
        /// </summary>
        /// <param name="patients">The patients.</param>
        /// <param name="weeks">The weeks.</param>
        /// <param name="copies">The copies.</param>
        /// <param name="printFormat">The print format.</param>
        /// <param name="opParam">The op.</param>
        public void PrintA3TemperaturCurve(IList<PatientData> patients, int weeks, int copies, PrintFormat printFormat, OperationData opParam)
        {
            if (patients == null || patients.Count == 0) {
                return;
            }

            if (copies < 1 || copies > 20) {
                return;
            }

            if (opParam != null && patients.Count != 1) {
                return;
            }

            IList<PrintablePage> printablePageA4 = new List<PrintablePage>();
            IList<PrintablePage> printablePageA3 = new List<PrintablePage>();

            PrintableDocument pd = new PrintableDocument();

            Font headlineFont = new Font("Arial", 18.0f, FontStyle.Underline | FontStyle.Bold);
            Font dateFont = new Font("Arial", 10.5f, FontStyle.Bold);
            Font printFont = new Font("Arial", 11, FontStyle.Bold);
            Font medicationFont = new Font("Arial", 10, FontStyle.Bold);
            Font symbolFont = new Font("Arial", 22, FontStyle.Bold);

            float leftMargin = 65;
            float topMargin = 30;

            foreach (PatientData patient in patients) {
                int daysSinceOp = 0;
                OperationData op;
                if (opParam == null) {
                    op = patComp.GetLastOperationByPatientID(patient.Id);
                } else {
                    op = opParam;
                }

                IList<string> medications = new List<string>();
                IList<int> medDays = new List<int>();
                bool hasCatheter = op.KathDays > 0;
                long kathDays = op.KathDays + 1; //CR ignoring OP Day.

                fillMedications(op, medications, medDays);

                //count = 0;

                DateTime opDate = op.Date;
                for (int week = 0; week < weeks; week++) {
                    //PrintablePage pp = new PrintablePage();
                    PrintablePage a4Page = new PrintablePage();
                    PrintablePage a3Page = new PrintablePage();

                    //Organ Images...
                    handleOrganImage(topMargin, op, a4Page, a3Page);

                    addPrintableTextObject(1, a4Page, a3Page, "Paediatric Urology Team Austria", headlineFont, new SolidBrush(Color.FromArgb(0, 61, 120)), leftMargin, topMargin + (float)(0 * 17.56));

                    addPrintableTextObject(1, a4Page, a3Page, "Paediatric Urology Team Austria", headlineFont, new SolidBrush(Color.FromArgb(0, 61, 120)), leftMargin, topMargin + (float)(0 * 17.56));
                    addPrintableTextObject(1, a4Page, a3Page, op.Date.Month.ToString() + " " + op.Date.Year.ToString() + "   Page: " + (week + 1), dateFont, Brushes.Red, leftMargin, topMargin + (float)28.74);

                    addPrintableTextObject(1, a4Page, a3Page, "Additional Information:", printFont, Brushes.Black, leftMargin + (float)610, topMargin + 10F);
                    //pp.AddPrintableObject(new PrintableTextObject("Notes - Final Report:", printFont, Brushes.Black, leftMargin + (float)635, topMargin + 120F));

                    addPrintableLineObject(1, a4Page, a3Page, Pens.Black, (int)leftMargin + 610, (int)topMargin + 27, (int)leftMargin + 635 + 175, (int)topMargin + 27);
                    //pp.AddPrintableObject(new PrintableLineObject(Pens.Black, (int)leftMargin + 635, (int)topMargin + 137, (int)leftMargin + 635 + 200, (int)topMargin + 137));

                    Bitmap imgKinderurologieLogo = SPD.GUI.Properties.Resources.KinderurologieLogo;
                    imgKinderurologieLogo.SetResolution(408, 408);
                    addPrintableImageObject(1, a4Page, a3Page, imgKinderurologieLogo, 500, (int)topMargin);

                    addPrintableRectangleObject(1, a4Page, a3Page, Brushes.Yellow, (int)leftMargin - 5 + 3, (int)topMargin + 198 - (2 * 17), 600, (int)printFont.GetHeight());

                    //Additional Info Rectangle
                    addPrintableRectangleObject(1, a4Page, a3Page, Pens.Black, (int)(leftMargin + 605), (int)topMargin, 300, 220);
                    addPrintableLineObject(1, a4Page, a3Page, Pens.Black, (int)(leftMargin + 605), (int)topMargin + 110, (int)(leftMargin + 605 + 300), (int)topMargin + 110);

                    List<string> addInfo = new List<string>();
                    addInfo.Add(op.Additionalinformation.Replace(Environment.NewLine, " "));
                    addInfo = this.SplitStringsForPrinting(40, addInfo);
                    int count = 0;
                    foreach (string line in addInfo) {
                        addPrintableTextObject(1, a4Page, a3Page, line, printFont, Brushes.Black, leftMargin + (float)610, topMargin + 27F + count * 17);
                        count++;
                    }

                    float y = (float)topMargin + (float)(3 * 17.56) + 9;

                    addPrintableTextObject(1, a4Page, a3Page, "Patient ID: " + patient.Id.ToString(), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "First name: " + patient.FirstName.Replace(Environment.NewLine, " "), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "Surname: " + patient.SurName.Replace(Environment.NewLine, " "), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    if (patient.DateOfBirth != null && patient.DateOfBirth.Year > 1800) {
                        addPrintableTextObject(1, a4Page, a3Page, "Birthdate: " + patient.DateOfBirth.ToShortDateString() + " - Age: " + StaticUtilities.getAgeFromBirthDate(patient.DateOfBirth), printFont, Brushes.Black, leftMargin, y);
                        y += 17;
                    }
                    addPrintableTextObject(1, a4Page, a3Page, "Resident of Asmara: " + patient.ResidentOfAsmara.ToString(), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "OP Date: " + op.Date.ToShortDateString(), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "OP Diagnosis:", printFont, Brushes.Black, leftMargin, y);
                    if (op.Diagnoses.Replace(Environment.NewLine, " ").Length > 60) {
                        List<string> diagnosesList = new List<string>();
                        diagnosesList.Add(op.Diagnoses.Replace(Environment.NewLine, " "));
                        diagnosesList = SplitStringsForPrinting(60, diagnosesList);
                        if (diagnosesList.Count >= 1) {
                            addPrintableTextObject(1, a4Page, a3Page, diagnosesList[0], printFont, Brushes.Black, leftMargin + 110, y);
                        }
                        if (diagnosesList.Count >= 2) {
                            y += 17;
                            addPrintableTextObject(1, a4Page, a3Page, diagnosesList[1], printFont, Brushes.Black, leftMargin + 110, y);
                        }
                    } else {
                        addPrintableTextObject(1, a4Page, a3Page, op.Diagnoses.Replace(Environment.NewLine, " "), printFont, Brushes.Black, leftMargin + 110, y);
                    }
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "Performed OP: " + op.Performed.Replace(Environment.NewLine, " "), printFont, Brushes.Black, leftMargin, y);
                    y += 17;
                    addPrintableTextObject(1, a4Page, a3Page, "OP Team: " + op.Team.Replace(Environment.NewLine, " "), printFont, Brushes.Black, leftMargin, y);

                    //Gray Box
                    addPrintableRectangleObject(1, a4Page, a3Page, Brushes.LightGray, 40, 270, 6 * 182, 30);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40 + j * 182, 270, 40 + j * 182, 270 + 7 * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 8; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40, 270 + j * 30, 40 + 6 * 182, 270 + j * 30);
                    }

                    ////Beschriftung begin

                    if (kathDays > (week * 12)) {
                        addPrintableTextObject(1, a4Page, a3Page, "catheter", printFont, Brushes.Black, 41, 305 + 5 * 30);
                    }

                    count = 0;
                    foreach (string medication in medications) {
                        if (week == 0) {
                            addPrintableTextObject(1, a4Page, a3Page, medication, medicationFont, Brushes.Black, 41, 305 + count * 30);
                        } else if (medDays[medications.IndexOf(medication)] >= ((week * 12) + 1)) {
                            addPrintableTextObject(1, a4Page, a3Page, medication, medicationFont, Brushes.Black, 41, 305 + count * 30);
                        }
                        for (int j = 0; j < 6; j++) {
                            int currentMedDay = (week * 12 + j) + 1;
                            if ((currentMedDay > 1) && (((currentMedDay - 1) % 6) != 0) && (medDays[count] >= (currentMedDay + 1))) {
                                addPrintableTextObject(1, a4Page, a3Page, "      -", symbolFont, Brushes.Black, 41 + j * 182, (305 + count * 30) - 10);
                            }
                            if ((medDays[count] == currentMedDay)) {
                                addPrintableTextObject(1, a4Page, a3Page, "      -          >", symbolFont, Brushes.Black, 41 + j * 182, (305 + count * 30) - 10);
                            }
                        }
                        count++;
                    }

                    for (int j = 0; j < 6; j++) {
                        int currentMedDay = (week * 12 + j) + 1;
                        if (hasCatheter && (currentMedDay == kathDays)) {
                            if (((kathDays - 1) % 12) == 0) {
                                addPrintableTextObject(1, a4Page, a3Page, "                 DK ex ", printFont, Brushes.Black, 41 + j * 182, 305 + 5 * 30);
                            } else {
                                addPrintableTextObject(1, a4Page, a3Page, "DK ex ", printFont, Brushes.Black, 41 + j * 182, 305 + 5 * 30);
                            }
                        } else if (hasCatheter && (currentMedDay < kathDays) && ((currentMedDay - 1) % 12) != 0) {
                            addPrintableTextObject(1, a4Page, a3Page, "      -", symbolFont, Brushes.Black, 41 + j * 182, 305 + 5 * 30 - 9);
                        }
                    }

                    //Kalendar Überschrift
                    for (int j = 0; j < 6; j++) {
                        addPrintableTextObject(1, a4Page, a3Page, "     " + opDate.DayOfWeek.ToString() + " " + opDate.ToShortDateString(), dateFont, Brushes.Blue, 41 + j * 182, 275);
                        if (daysSinceOp == 0) {
                            addPrintableTextObject(1, a4Page, a3Page, "op", dateFont, Brushes.Red, 41 + j * 182, 275);
                        } else {
                            addPrintableTextObject(1, a4Page, a3Page, daysSinceOp.ToString(), dateFont, Brushes.Red, 41 + j * 182, 275);
                        }
                        opDate = opDate.AddDays(1.0);
                        daysSinceOp++;
                    }

                    //// Beschriftung ende

                    int yNursing = 500;
                    addPrintableTextObject(1, a4Page, a3Page, "Nursing and medical orders:", printFont, Brushes.Black, 41, yNursing);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40 + j * 182, yNursing + 20, 40 + j * 182, yNursing + 150);
                    }
                    //horizintal lines
                    addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40, yNursing + 20, 40 + 6 * 182, yNursing + 20);
                    addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40, yNursing + 150, 40 + 6 * 182, yNursing + 150);

                    int yTemperature = 670;
                    addPrintableTextObject(1, a4Page, a3Page, "Temperature:", printFont, Brushes.Black, 41, yTemperature);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40 + j * 182, yTemperature + 20, 40 + j * 182, yTemperature + 20 + 1/*=number of lines*/ * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 2; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40, yTemperature + 20 + j * 30, 40 + 6 * 182, yTemperature + 20 + j * 30);
                    }

                    //Local status
                    int yLocalStatus = 735;
                    addPrintableTextObject(1, a4Page, a3Page, "Localstatus:", printFont, Brushes.Black, 41, yLocalStatus);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40 + j * 182, yLocalStatus + 20, 40 + j * 182, yLocalStatus + 20 + 1/*=number of lines*/ * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 2; j++) {
                        addPrintableLineObject(1, a4Page, a3Page, Pens.Black, 40, yLocalStatus + 20 + j * 30, 40 + 6 * 182, yLocalStatus + 20 + j * 30);
                    }

                    printablePageA4.Add(a4Page);
                    a4Page = new PrintablePage();

                    a3Page.AddPrintableObject(new PrintableLineObject(Pens.LightGray, 0, A4smallSite + 45, A4LargeSite, A4smallSite + 45));

                    //2. seite

                    addPrintableTextObject(2, a4Page, a3Page, "Patient ID: " + patient.Id.ToString(), printFont, Brushes.Black, leftMargin, 13 + 45);

                    //Gray Box
                    int calendary = (int)topMargin + 45;
                    addPrintableRectangleObject(2, a4Page, a3Page, Brushes.LightGray, 40, calendary, 6 * 182, 30);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40 + j * 182, calendary, 40 + j * 182, calendary + 7 * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 8; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40, calendary + j * 30, 40 + 6 * 182, calendary + j * 30);
                    }

                    ////Beschriftung begin

                    if (kathDays > ((week * 12) + 6)) {
                        addPrintableTextObject(2, a4Page, a3Page, "catheter", printFont, Brushes.Black, 41, calendary + 5 + 6 * 30);
                    }

                    count = 0;
                    foreach (string medication in medications) {
                        if (medDays[medications.IndexOf(medication)] >= ((week * 12) + 7)) {
                            addPrintableTextObject(2, a4Page, a3Page, medication, medicationFont, Brushes.Black, 41, calendary + 5 + 30 + count * 30);
                        }
                        for (int j = 0; j < 6; j++) {
                            int currentMedDay = (week * 12 + j) + 1 + 6;
                            if (((currentMedDay - 1) % 6) != 0 && (medDays[count] >= (currentMedDay + 1))) {
                                addPrintableTextObject(2, a4Page, a3Page, "      -", symbolFont, Brushes.Black, 41 + j * 182, (calendary + 5 + 30 + count * 30) - 10);
                            }
                            if ((medDays[count] == currentMedDay)) {
                                addPrintableTextObject(2, a4Page, a3Page, "      -          >", symbolFont, Brushes.Black, 41 + j * 182, (calendary + 5 + 30 + count * 30) - 10);
                            }
                        }
                        count++;
                    }

                    for (int j = 0; j < 6; j++) {
                        int currentMedDay = (week * 12 + j) + 1 + 6;
                        if (hasCatheter && (currentMedDay == kathDays)) {
                            if (((kathDays - 7) % 12) == 0) {
                                addPrintableTextObject(2, a4Page, a3Page, "                 DK ex ", printFont, Brushes.Black, 41 + j * 182, calendary + 5 + 6 * 30);
                            } else {
                                addPrintableTextObject(2, a4Page, a3Page, "DK ex ", printFont, Brushes.Black, 41 + j * 182, calendary + 5 + 6 * 30);
                            }
                        } else if (hasCatheter && (currentMedDay < kathDays) && ((currentMedDay - 7) % 12) != 0) {
                            addPrintableTextObject(2, a4Page, a3Page, "      -", symbolFont, Brushes.Black, 41 + j * 182, calendary + 5 + 6 * 30 - 9);
                        }
                    }

                    //Kalendar Überschrift
                    for (int j = 0; j < 6; j++) {
                        addPrintableTextObject(2, a4Page, a3Page, "     " + opDate.DayOfWeek.ToString() + " " + opDate.ToShortDateString(), dateFont, Brushes.Blue, 41 + j * 182, calendary + 5);
                        if (daysSinceOp == 0) {
                            addPrintableTextObject(2, a4Page, a3Page, "op", dateFont, Brushes.Red, 41 + j * 182, calendary + 5);
                        } else {
                            addPrintableTextObject(2, a4Page, a3Page, daysSinceOp.ToString(), dateFont, Brushes.Red, 41 + j * 182, calendary + 5);
                        }
                        opDate = opDate.AddDays(1.0);
                        daysSinceOp++;
                    }

                    //// Beschriftung ende

                    yNursing = 295;
                    addPrintableTextObject(2, a4Page, a3Page, "Nursing and medical orders:", printFont, Brushes.Black, 41, yNursing);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40 + j * 182, yNursing + 20, 40 + j * 182, yNursing + 150);
                    }
                    //horizintal lines
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40, yNursing + 20, 40 + 6 * 182, yNursing + 20);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40, yNursing + 150, 40 + 6 * 182, yNursing + 150);

                    yTemperature = 455;
                    addPrintableTextObject(2, a4Page, a3Page, "Temperature:", printFont, Brushes.Black, 41, yTemperature);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40 + j * 182, yTemperature + 20, 40 + j * 182, yTemperature + 20 + 1/*=number of lines*/ * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 2; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40, yTemperature + 20 + j * 30, 40 + 6 * 182, yTemperature + 20 + j * 30);
                    }

                    //Local Status
                    yLocalStatus = 520;
                    addPrintableTextObject(2, a4Page, a3Page, "Localstatus:", printFont, Brushes.Black, 41, yLocalStatus);
                    //vertical lines
                    for (int j = 0; j < 7; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40 + j * 182, yLocalStatus + 20, 40 + j * 182, yLocalStatus + 20 + 1/*=number of lines*/ * 30);
                    }
                    //horizintal lines
                    for (int j = 0; j < 2; j++) {
                        addPrintableLineObject(2, a4Page, a3Page, Pens.Black, 40, yLocalStatus + 20 + j * 30, 40 + 6 * 182, yLocalStatus + 20 + j * 30);
                    }

                    int y3rdBlock = 580;
                    int widthlastbox = 335;
                    int xft = 41;
                    int xcont = xft + widthlastbox + xft;
                    int xfo = xft + widthlastbox + xft + widthlastbox + xft;

                    addPrintableTextObject(2, a4Page, a3Page, "Further Treatment for discharge:", printFont, Brushes.Black, xft, y3rdBlock);
                    addPrintableTextObject(2, a4Page, a3Page, "Control(s) planned for:", printFont, Brushes.Black, xcont, y3rdBlock);
                    addPrintableTextObject(2, a4Page, a3Page, "Further operation planned for:", printFont, Brushes.Black, xfo, y3rdBlock);

                    //3 oberen Linien der Boxen
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft, y3rdBlock + 20, xft + widthlastbox, y3rdBlock + 20);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft, y3rdBlock + 20, xft + widthlastbox + xft + widthlastbox, y3rdBlock + 20);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft + widthlastbox + xft, y3rdBlock + 20, xft + widthlastbox + xft + widthlastbox + xft + widthlastbox, y3rdBlock + 20);
                    //3 unteren Linien der Boxen
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft, y3rdBlock + 177, xft + widthlastbox, y3rdBlock + 177);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft, y3rdBlock + 200, xft + widthlastbox + xft + widthlastbox, y3rdBlock + 200);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft + widthlastbox + xft, y3rdBlock + 200, xft + widthlastbox + xft + widthlastbox + xft + widthlastbox, y3rdBlock + 200);

                    //vertikale Linien der Boxen
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft, y3rdBlock + 20, xft, y3rdBlock + 177);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox, y3rdBlock + 20, xft + widthlastbox, y3rdBlock + 177);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft, y3rdBlock + 20, xft + widthlastbox + xft, y3rdBlock + 200);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft + widthlastbox, y3rdBlock + 20, xft + widthlastbox + xft + widthlastbox, y3rdBlock + 200);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft + widthlastbox + xft, y3rdBlock + 20, xft + widthlastbox + xft + widthlastbox + xft, y3rdBlock + 200);
                    addPrintableLineObject(2, a4Page, a3Page, Pens.Black, xft + widthlastbox + xft + widthlastbox + xft + widthlastbox, y3rdBlock + 20, xft + widthlastbox + xft + widthlastbox + xft + widthlastbox, y3rdBlock + 200);

                    addPrintableTextObject(2, a4Page, a3Page, "Treatment completed: yes        no", printFont, Brushes.Black, xft, y3rdBlock + 180);
                    addPrintableRectangleObject(2, a4Page, a3Page, Pens.Black, xft + 195, y3rdBlock + 180, 20, 20);
                    addPrintableRectangleObject(2, a4Page, a3Page, Pens.Black, xft + 246, y3rdBlock + 180, 20, 20);

                    printablePageA4.Add(a4Page);
                    printablePageA3.Add(a3Page);
                }
            }

            pd.PrintPageList = printablePageA3;
            pd.duplicate(copies);
            pd.Landscape = false;
            pd.DocumentName = "SPD Temperature Curve A3";

            PrintDialog printDialog = null;

            if (printFormat == PrintFormat.A3) {
                pd.PaperKindOrNothing = PaperKind.A3;

                printDialog = pd.DoPrint();

                if (printDialog != null) {
                    pd.PaperKindOrNothing = PaperKind.A4;
                    pd.Landscape = true;
                    pd.PrintPageList = printablePageA4;
                    pd.duplicate(copies);
                    printDialog = pd.DoPrint(printDialog);
                }

            } else if (printFormat == PrintFormat.A4) {
                pd.PaperKindOrNothing = PaperKind.A4;

                printDialog = pd.DoPrint();
            }

            if (printDialog != null) {
                MessageBox.Show("Sorry - printing not possible!");
            }
        }
        /// <summary>
        /// Prints the next appointment.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="diagnoses">The diagnoses.</param>
        /// <param name="todo">The todo.</param>
        /// <param name="date">The date.</param>
        /// <param name="time">The time.</param>
        /// <param name="numberOfSheets">The number of sheets.</param>
        public void PrintNextAppointment(PatientData patient, string diagnoses, string todo, string date, string time, int numberOfSheets)
        {
            if (patient == null) {
                return;
            }

            float leftMargin = 100;
            float topMargin = 100;

            Font headlineFont = new Font("Arial", 18.0f, FontStyle.Bold);
            Font dateFont = new Font("Arial", 12f, FontStyle.Bold);
            Font pointFont = new Font("Arial", 15f, FontStyle.Bold);
            Font printFont = new Font("Arial", 11, FontStyle.Regular);
            Font barCodeFont = null;
            if (StaticUtilities.IsFontInstalled("Free 3 of 9 Extended") && SPD.GUI.Properties.Settings.Default.Barcode) {
                barCodeFont = new Font("Free 3 of 9 Extended", 35, FontStyle.Regular, GraphicsUnit.Point);
            }

            //HeadlineFont: 27,59766
            //dateFont: 18,39844
            //printFont: 16,86523

            PrintableDocument pd = new PrintableDocument();
            pd.DocumentName = "SPD Next Appointment";

            PrintablePage pp = new PrintablePage();
            OperationData od = patComp.GetLastOperationByPatientID(patient.Id);

            putLetterhead(pp);

            float yPos = (float)topMargin + (float)(4 * 16.86523);

            pp.AddPrintableObject(new PrintableTextObject("NEXT OUTPATIENT APPOINTMENT", headlineFont, Brushes.Red, leftMargin + 100, yPos));
            yPos += 16.86523F;
            yPos += 16.86523F;
            yPos += 16.86523F;
            if (barCodeFont != null) {
                pp.AddPrintableObject(new PrintableTextObject(String.Format("*000000{0}*", patient.Id.ToString()), barCodeFont, Brushes.Black, 500, yPos));
            }
            pp.AddPrintableObject(new PrintableTextObject("Printed: " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(), printFont, Brushes.Black, leftMargin, yPos));
            yPos += 16.86523F;
            yPos += 16.86523F;
            pp.AddPrintableObject(new PrintableTextObject("Patient ID: " + patient.Id.ToString(), pointFont, Brushes.Black, leftMargin, yPos));
            yPos += 25F;
            pp.AddPrintableObject(new PrintableTextObject("Name: " + patient.FirstName + " " + patient.SurName, pointFont, Brushes.Black, leftMargin, yPos));
            yPos += 25F;
            pp.AddPrintableObject(new PrintableTextObject("Date: " + date, pointFont, Brushes.Black, leftMargin, yPos));
            yPos += 25F;
            pp.AddPrintableObject(new PrintableTextObject("Time: " + time, pointFont, Brushes.Black, leftMargin, yPos));
            yPos += 25F;
            pp.AddPrintableObject(new PrintableTextObject("Place: " + SPD.GUI.Properties.Settings.Default.Location, pointFont, Brushes.Black, leftMargin, yPos));
            yPos += 25F;
            yPos += 16.86523F;
            pp.AddPrintableObject(new PrintableTextObject("Birthdate: " + patient.DateOfBirth.ToShortDateString() + " - Age: " + StaticUtilities.getAgeFromBirthDate(patient.DateOfBirth), printFont, Brushes.Black, leftMargin, yPos));
            yPos += 16.86523F;
            yPos += 16.86523F;
            yPos += 16.86523F;
            pp.AddPrintableObject(new PrintableTextObject("Diagnoses:", dateFont, Brushes.Black, leftMargin, yPos));
            yPos += 16.86523F;

            List<string> diagnosesList = new List<string>();
            diagnosesList.Add(diagnoses);
            diagnosesList = SplitStringsForPrinting(80, diagnosesList);
            foreach (string diagnosesLine in diagnosesList) {
                pp.AddPrintableObject(new PrintableTextObject(diagnosesLine, printFont, Brushes.Black, leftMargin, yPos));
                yPos += 16.86523F;
                if (yPos > 1050) {
                    yPos = topMargin;
                    pd.AddPrintPage(pp);
                    pp = new PrintablePage();
                }
            }

            yPos += 16.86523F;
            pp.AddPrintableObject(new PrintableTextObject("TODO:", dateFont, Brushes.Black, leftMargin, yPos));
            yPos += 16.86523F;
            List<string> todoList = new List<string>();
            todoList.Add(todo);
            todoList = SplitStringsForPrinting(80, todoList);
            foreach (string todoLine in todoList) {
                pp.AddPrintableObject(new PrintableTextObject(todoLine, printFont, Brushes.Black, leftMargin, yPos));
                yPos += 16.86523F;
                if (yPos > 1050) {
                    yPos = topMargin;
                    pd.AddPrintPage(pp);
                    pp = new PrintablePage();
                }
            }

            pd.AddPrintPage(pp);

            pd.duplicate(numberOfSheets);

            pd.DoPrint();
        }