Bruno Lowagie (iText) wrote:
>
> dmholte wrote:
>> I've also tried using MultiColumnText, but am not sure if I am using it
>> correctly with the HTMLWorker component.
>
> Without seeing the original HTML, we can't help.
> Maybe there's something in it that causes the new page.
> br,
> Bruno
>
> ------------------------------------------------------------------------------
>
Hi Bruno, the variable String HospNote contains the original html. It is
also in the original source code. I've pasted it here for you - I've added
the entire makePdf() method. . I apologize -it is quite long.
public void makePDF(){
String HospNote = "<table width='100%'><tr><td>Patient,
Test</td><td>123456-1</td><td width='50%'>Discharge Summary</td></tr><tr><td
colspan='3'>ADMISSION DATE: 03/23/2000 DISCHARGE
DATE:<br>03/26/2000<br><br>DISCHARGE DIAGNOSIS: 1. Respiratory arrest,
secondary to mucus<br>plugging.<br> 2. Coronary artery disease, status post
myocardial<br> infarction on 9-21-99.<br> 3. Status post coronary artery
bypass grafting<br> times 2 on 9-27-99.<br> 4. Status post myocutaneous flap
for<br> mediastinitis, secondary closure.<br> 5. Insulin dependent diabetes
mellitus, type 2.<br> 6. Hyperlipidemia.<br> 7. Hypertension.<br> 8.
Cerebrovascular accident, 11-93.<br> 9. Left radical mastectomy with
radiation therapy<br> for breast cancer in March, 1993.<br> 10. Degenerative
joint disease, status post L4-L5<br> decompression laminectomy.<br> 11.
Neurogenic claudication.<br><br>PROCEDURES OR OPERATIONS:
None.<br><br>CONSULTATIONS: 3/24/00 - Nutrition Services - to review need of
feeding<br>tube placement. Calorie count was on 3/24/00 was 1300 calories
and 55<br>grams of protein, and therefore, no feeding tube was
replaced.<br><br>DISCHARGE MEDICATIONS: 1. Chemstrips q 4 hrs. with sliding
scale insulin<br>for blood sugar of:<br> Blood sugar between80-180 no
coverage;<br> 181-250 2<br> units Regular Insulin SQ;<br> 251-300 5<br>
units;<br> 301-350 6<br> units;<br> 351-400 8<br> units;<br> greater than
400 units, give 10 units and call physician.<br> 2. Insulin NPH 18 units
q.a.m. and 18 units q.p.m.<br> 3. Regular insulin, 10 units, q.a.m., 4
units<br> q.noon, 6 units q.p.m.<br> 4. Lopressor 50 mg. p.o. b.i.d.<br> 5.
Cozaar 50 mg. p.o. q.d.<br> 6. Prozac 20 mg. p.o. q.d.<br> 7. Lasix 80 mg.
p.o. b.i.d.<br> 8. Maxzide 50/75, 1 p.o. q.d.<br> 9. Prevacid 30 mg. p.o.
q.h.s.<br> 10. Lanoxin 0.125 mg. p.o. q.d.<br> 11. Heparin 5,000 units subq.
q.12 h.<br> 12. K-Dur 20 milliequivalents p.o. q.d.<br> 13. Claritin 10 mg.
p.o. q.d.<br> 14. Flonase, one spray each nostril b.i.d.<br> 15. Combivent
inhaler 4 puffs q.4.h.<br> 16. Ambien 10 mg. q.h.s. p.r.n.<br> 17. Laxative
of choice. Laxative results recorded<br> on activities of daily living
record.<br> 18. Tylenol suspension 650 mg. p.o. q.4-6 h.<br> p.r.n.<br> 19.
Xanax 0.25 mg. t.i.d. p.r.n., not to be given<br> in the same shift as
Ambien.<br> 20. Oxygen therapy per trach collar during the<br> day. Start at
30% to keep SATS greater than<br> 90%. BiPAP setting 20/5 with 4 liters of
O2<br> bleed in the night with long #6 Shiley inner<br> cannula with cuff
inflated. While on trach<br> collar, we will have a short inner cannula<br>
placed with no cuff inflation.<br><br>DISCHARGE DISPOSITION: 1. Condition on
discharge: improved.<br> 2. Immediate destination: Hillview Nursing Home<br>
for continued medical care.<br> 3. Activity: activity as tolerated.<br> 4.
Diet: soft dental diet with continued calorie<br> and protein counts.
Attention deficit disorder<br> Boost Plus to meal plans t.i.d. with meals
and<br> b.i.d. with snacks. Dietary to work with family<br> to provide
favorite foods at patient request.<br> Fluid restriction of this patient is
2,500 cc.<br> per day.<br> 5. Oxygen therapy: she will receive 30%
humidified<br> O2 per trach collar to keep saturations greater<br> than 90%.
At night she will BiPAP with setting<br> of 20/5 with 4 liters of O2 bled
in. A #6<br> Shiley inner cannula will be placed with the<br> cuff inflated.
While on the trach collar during<br> the day, a shorter inner cannula will
be placed<br> with no cuff inflated. The patient may be<br> placed on a
Passey Muir valve during the day<br> while on trach collar for ability to
speak.<br> Last trach change was 2-28-00.<br> 6. Physical Therapy at the
nursing home to<br> increase activities of daily living. Dressing<br>
changes will be done q.d. Instructions for<br> dressing changes include
cleanse area with<br> Saf-Clens solution and then pack wound with<br>
Aquacel dressing and cover with gauze and then<br> cover with a large
Tegaderm patch with skin prep<br> before applying Tegaderm.<br> 7. Code
status: full code.<br> 8. Follow up plans: Patient should follow up with<br>
Dr. Pak's nurse practitioner in one week, with<br> Pulmonary in one week,
and Endocrinology in one<br> week.<br><br> 9. DURABLE MEDICAL EQUIPMENT:
BiPAP machine<br><br> 10. ALLERGIES: No known drug allergies.<br><br> 11.
CODE STATUS: Full code.<br><br> 12. Hospital Care: In the future for
immediate<br> care she will be cared transferred to Saint<br> Francis per
her health insurance guidelines.<br><br>SUMMARY OF ESSENTIAL FACTS OF
HISTORY AND PHYSICAL: Mrs. Test Patient is a<br>72-year-old who is status
post coronary artery bypass grafting times 2 on<br>September 27, 1999 with a
very complicated hospital course, including<br>chronic respiratory
insufficiency, requiring a tracheostomy and nocturnal<br>BiPAP. She was
discharged to Hillview Nursing Home on 2-3-00 and required<br>re-admission
to Gundersen Lutheran 2-17-00 for hypercapnic respiratory<br>failure. She
was discharged to Hillview Nursing Home for a second time on<br>2-28-00 and
was doing very well with physical therapy and wound healing<br>until March
23, 2000, when it was reported to her daughter that while she<br>was
preparing to switch from BiPAP she had respiratory rest and
cyanosis.<br>Paramedics were able to suction the mucus plug and ambu bag her
and she was<br>revived quickly where she was taken to Gundersen
Lutheran.<br><br>Physical exam on admission: In general, Mrs Test Patient is
a well nourished<br>72-year-old white female, who was alert, oriented and
appeared in no<br>apparent distress on BiPAP. Vital signs included a
temperature of 36.1,<br>pulse 82, BP 100/35, respiratory rate of 20, with an
SPO2 of 100% on BiPAP<br>with 4 liter bleed of O2. Head, eyes, ears, nose
and throat, pupils equal,<br>round, reactive to light and accommodation.
Extraocular movements intact.<br>She did have bilateral conjunctival
injection, but there was no discharge<br>noted. Heart was regular rate and
rhythm with a grade 4-6 systolic murmur.<br>Her lungs had diminished breath
sounds with wheezing on the left. No<br>crackles were audible, however, her
breathing was quite shallow. Abdomen<br>was soft, nontender, obese with good
bowel sounds in all quadrants.<br>Extremities, radial pulses palpable at 3+,
dorsalis pedis pulses were<br>dopplerable bilaterally. She had +3 edema to
her shins on both legs.<br><br>Her admission ABG showed a pH 7.29, pCO2 of
68.9, pO2 of 119.2, and an HCO3<br>of 32.6. It was noted that an ABG done
two weeks ago had a pCO2 of 52, and<br>one week ago her pCO2 was 55. INR was
found to be 0.9, PTT 27.9, CPK 38,<br>WBC 13.7, HGB 9.5, neutrophils were
elevated at 79% with segs at 68% and<br>bands at 14% which were slightly
high. Chest x-ray showed some volume loss<br>in the left lung with increased
vascular congestion on the right.<br>Electrocardiogram showed no new ST
depressions or T wave changes.<br><br>ADMISSION MEDICATIONS:1. Lopressor 50
mg. p.o. b.i.d.<br> 2. Cozaar 50 mg. p.o. q.d.<br> 3. Prozac 20 mg. p.o.
q.d.<br> 4. Lasix 80 mg. p.o. b.i.d.<br> 5. Maxzide 50/75, 1 p.o. q.d.<br>
6. Prevacid 30 mg. p.o. q.h.s.<br> 7. Lanoxin 0.125 mg., p.o. q.d.<br> 8.
Heparin 5,000 units subq. q.12 h.<br> 9. K-Dur 20 mg. p.o. q.d.<br> 10.
Claritin 10 mg. p.o. q.d.<br> 11. Flonase one spray each nostril b.i.d.<br>
12. Combivent inhaler q.4.h.<br> 13. Ambien 10 mg. q.h.s. p.r.n.<br> 14.
Laxative of choice<br> 15. Tylenol suspension 650 mg. p.o. q.4-6 h.<br>
p.r.n.<br> 16. Xanax 0.25 mg. t.i.d. p.r.n., not to be<br> given in the same
shift as Ambien.<br> 17. Oxygen therapy per trach collar during<br> the day
at 30% to keep SATS greater than<br> 90% BiPAP setting of 20/5 with 4 liters
of<br> O2 bleed in at night.<br> 18. Insulin sliding scale. In addition,
she<br> received NPH 8 units subq. at 6:30 a.m.;<br> NPH 8 units subq. at 12
noon; and NPH 100<br> units subq. at 1800; and NPH 8 units subq.<br> at
2400. Regular insulin, 10 units subq.<br> q.a.m.; regular insulin 4 units
subq. 12<br> o'clock, and regular insulin 54 units<br> subq. q.p.m. Of note,
the NPH 100 units<br> subq. and the regular insulin 54 units<br> subq. were
given at the beginning of the<br> tube feeding of Ensure Plus 100 cc. an<br>
hour from 6 p.m. to 4 a.m., which no<br> longer occurs.<br><br>HOSPITAL
COURSE: Mrs Test patient is a 72-year-old white female, who is a
patient<br>of Dr.. Buckley, was admitted for a respiratory arrest secondary
to mucus<br>plugging and chronic respiratory failure. Her chest x-ray showed
slight<br>vascular congestion, and therefore, she was diuresed initially
with 40 mg.<br>of Lasix IV. Electrocardiogram was obtained and showed no new
ST or T wave<br>changes. Mary had complaints lately of chest pain, but she
believes that<br>this is due to the chest compressions that she had received
at the nursing<br>home. Two normal CPK were obtained and the results were 34
and 38<br>respectively. On BiPAP overnight her ABG improved to pH 7.4, pACO2
of 55,<br>pAO2 of 64, bicarb of 36, pulse ox of 95%, and this was taken on 4
liter<br>bleed with BiPAP 20/5.<br><br>During the respiratory arrest at the
nursing home, apparently the feeding<br>tube was displaced and, therefore,
pulled out. A Nutrition Services<br>consult was obtained and her calorie
needs were estimated to be 1,700 to<br>1,950 with protein needs between
65-98 grams. We discussed replacement of<br>feeding tube with patient and
family and they decided that a trial of oral<br>intake would help assess
whether the feeding tube needed to be replaced.<br>She was placed on a
mechanical soft diet and given Boost Plus with meals<br>t.i.d. and b.i.d.
with snacks. Often times her chemstick checks were<br>directly after the
Boost drinks, and therefore, her blood sugars ran high<br>throughout the
hospitalization between 200-400. Extra insulin was provided<br>through
sliding scale, and she was placed on NPH 18 units b.i.d. to try
to<br>provide longer term coverage. Patient continued to do well and
was<br>afebrile throughout the hospital course. She was given one dose
of<br>ceftriaxone 1 gram IV because of her high WBC on her initial
admission<br>labs. She remained afebrile, and there was no evidence of
pulmonary<br>infiltrates on chest x-ray, and therefore, after the one dose
the<br>ceftriaxone was discontinued.<br><br>On 3-26-00, it was noted that
her weight had increased 6 kilogram since her<br>admission weight of 95.8
kilogram, and therefore, she was given 20 mg. of<br>Lasix IV. Her
nutritional status improved. She was able to ambulate 50<br>feet in the
hallways with physical therapy, and her breathing returned to<br>baseline
and we discussed plans to return to Hillview with the Test Patient
family.<br>Her intake remained good and her calorie count on 3-26-00 showed
calories<br>of 1600 and 61.9 grams of protein. The patient requested
Resource juice<br>instead of Boost Plus, but it was explained to her that
Resource has only<br>half the calories and protein of Boost Plus. She agreed
to continue with<br>the Boost Plus with meals t.i.d. and wanted to try the
Resource juice<br>drinks b.i.d. with snacks.<br><br>Mrs Test patient, Mr.
Test Patient, and their adult daughter discussed the plan to have<br>further
care at Saint Mary's Test Hospital under their health plan
guidelines.<br>They had an extension of care given until April 7th for this
visit.<br><br><br><br>Electronically signed by<br>Gregory P. Doctor, M.D.
03/27/2000 10:19<br>Gregory P. Doctor, M.D.<br><br>Dictator R. Dictator,
M.D. DICTATOR<br><br>DD: 03/26/200011:08 A<br>DT: 03/26/2000 12:11
P<br>Document 682341<br>sag<br><br>CC: Nursing Home<br> Julie k. Doctor,
M.D.</td></tr></table>";
String medrec = "123456";
Date jDate = new Date();
long lngDate =jDate.getTime();
try{
Document document = new Document(); //Step 1 create the document
object
outPutFile = outPutPath + medrec + "_" + lngDate + "_ROI.pdf";
System.out.println("The outputfile" + outPutFile);
FileOutputStream fo = new FileOutputStream(outPutFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter writer = PdfWriter.getInstance(document,fo); //step 2
create a writer
writer.setPageEvent(new ParseBuildPdf());
Phrase headerPhrase = new Phrase();
Chunk newLn = new Chunk("");
Chunk noteType = new Chunk("Release Of Information-Hospital
Notes",FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD));
Chunk medRecLable = new Chunk ("Medical Record:
",FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD));
Chunk medRecno =new Chunk(medrec,
FontFactory.getFont(FontFactory.HELVETICA, 10, Font.BOLD));
headerPhrase.add(noteType);
headerPhrase.add(newLn.NEWLINE);
headerPhrase.add(medRecLable);
headerPhrase.add(medRecno);
//Create header footer objects
HeaderFooter header = new HeaderFooter(headerPhrase,false);
header.setBorder(Rectangle.BOTTOM);
header.setAlignment(com.lowagie.text.Element.ALIGN_LEFT);
document.setMargins(25, 25, 30, 30); //left,right,top,bottom
document.setHeader(header); //adds the Header on all pages (Step 4
adding Content)
document.open();
ArrayList p = HTMLWorker.parseToList(new
StringReader(HospNote),null);
for (int k=0;k<p.size(); ++k)
document.add((Element)p.get(k)); //step 4 adding
content- the note
//iText method onOpen is called here
document.close();
baos.writeTo(fo);
try {fo.flush();}catch(Exception e){;}
try {fo.close();}catch(Exception e){;}
try {baos.close();}catch(Exception e){;}
fo = null;
baos = null;
}//end try
catch(Exception e){
System.err.println("Viewing error in ROIBuild pdf" + e);
}
} //end makePDF.
--
View this message in context:
http://www.nabble.com/HTML-Parser-Blank-Page-in-PDF-tp24094014p24111039.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/