c++ : pdf to dicom
Moderator: Moderator Team
-
- Posts: 27
- Joined: Mon, 2020-01-20, 11:36
c++ : pdf to dicom
Hi there,
Is there a way to encapsulate a pdf in a dicom object using one of the libraries instead of using pdf2dcm?
I know of 2 options but they don't fulfill the requirements mentioned in my question
1. save the pdf as .jpg/.bmp
2. use createProcess ( winapi ) and call pdf2dcm in my code
Is there a way to encapsulate a pdf in a dicom object using one of the libraries instead of using pdf2dcm?
I know of 2 options but they don't fulfill the requirements mentioned in my question
1. save the pdf as .jpg/.bmp
2. use createProcess ( winapi ) and call pdf2dcm in my code
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: c++ : pdf to dicom
3. Would be to use the existing class DcmEncapsulatedDocument.
4. Would be my preferred (and recommended) way: Write your own C++ class/function based on DCMTK's functionality to create DICOM datasets (see dcmdata).
4. Would be my preferred (and recommended) way: Write your own C++ class/function based on DCMTK's functionality to create DICOM datasets (see dcmdata).
-
- Posts: 27
- Joined: Mon, 2020-01-20, 11:36
Re: c++ : pdf to dicom
Thanks J.Reismeier,
are there good examples where the dcmencapsulateddocument is used ? The documentation looks good but I'm just wondering if there were code snippets on the net. I tried looking for it here on the forum ....but no luck.
are there good examples where the dcmencapsulateddocument is used ? The documentation looks good but I'm just wondering if there were code snippets on the net. I tried looking for it here on the forum ....but no luck.
-
- Posts: 27
- Joined: Mon, 2020-01-20, 11:36
Re: c++ : pdf to dicom
J.Reismeier,
i thought I look at the way pdf2dcm commandline tool is doing it, so I guess I found my example.... or are there more?
i thought I look at the way pdf2dcm commandline tool is doing it, so I guess I found my example.... or are there more?
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: c++ : pdf to dicom
I think this is the only example (so far). Actually, the class DcmEncapsulatedDocument has been implemented in a way that it mainly supports the command line tools pdf2dcm, cda2dcm and stl2dcm. That's why I recommended the 4th approach (see above).
-
- Posts: 27
- Joined: Mon, 2020-01-20, 11:36
Re: c++ : pdf to dicom
I have a class that generates the DICOM dataset with the proper ID's and such, but wouldn't I still need the DcmEncapsulatedDocument class to encapsulate the pdf in the dataset ? that is what I'm trying now ..... on a different note I'm not able to view the encapsulated pdf in a viewer on Orthanc so I decided to do the test first with pdf2dcm and see whether I can get a proper pdf view on Orthanc, but this viewing issue is a slightly different problem I have to tackle.... just sharing my M.O.
-
- DCMTK Developer
- Posts: 2506
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: c++ : pdf to dicom
No, you simply need to copy the content of the PDF file to the element value of the Encapsulated Document (0042,0011) attribute (and add the other data elements that are needed for the Encapsulated PDF Document IOD).I have a class that generates the DICOM dataset with the proper ID's and such, but wouldn't I still need the DcmEncapsulatedDocument class to encapsulate the pdf in the dataset ?
-
- Posts: 27
- Joined: Mon, 2020-01-20, 11:36
Re: c++ : pdf to dicom
Thanks for the advice, it works !!!
Who is online
Users browsing this forum: Bing [Bot] and 1 guest