Friday, February 10, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: 孙磊
New Today New Today: 1
New Yesterday New Yesterday: 27
User Count Overall: 20591

People Online People Online:
Visitors Visitors: 10
Members Members: 0
Total Total: 10

Online Now Online Now:

ClearCanvas Community Forums

How to extract a PDF from EncapsulatedPDF?
Last Post 2010-05-27 11:08 AM by stewart. 5 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ta007
Basic Member
Basic Member
Posts:15

--
2010-05-18 04:49 AM  

Dear Forum,

We have several topics with information how to extract pixel data from DICOM file, but question is - how to extract PDF content from DICOM file and save to PDF?

ta007
Basic Member
Basic Member
Posts:15

--
2010-05-19 10:05 AM  

The PDF content in encapsulated PDF is in DicomTags.EncapsulatedDocument DICOM TAG. It is a UINT type. What streamwriter shoudl I use to save the UINT in file?

I wrote following code:

using (FileStream stream = new FileStream("C:\\mysecretfile.pdf", FileMode.Create))

            {
                using (XXX writer = new XXX())
                {
                    writer.Write(dcm.DataSet[DicomTags.EncapsulatedDocument]);
                    writer.Close();
                }
            }

 

 

ta007
Basic Member
Basic Member
Posts:15

--
2010-05-20 01:08 AM  

Ok, I found the solution - BinaryWriter :)

robertvanommen
Basic Member
Basic Member
Posts:26

--
2010-05-20 02:19 AM  

can u give a example in code of how to write dicom encapsulated pdf?

ta007
Basic Member
Basic Member
Posts:15

--
2010-05-20 08:27 AM  

I'm sorry, but I cannot help - I know only how to extract PDF from EncPDF dicom file.

stewart
Senior Member
Senior Member
Posts:2033

--
2010-05-27 11:08 AM  
If you have an existing DICOM PDF file, it would be pretty straightforward to reverse engineer it to create your own. Write a method that creates a DICOM file and adds all the correct DICOM attributes to it. Then use BinaryReader to read the PDF file and set the "Encapsulated Document" DICOM attribute's value (as a byte[]), then save.
Real-time support available to Clinical Edition and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.