comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4407:2412601cd24b

cont openapi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Dec 2020 17:44:52 +0100
parents 4cb9f66a1c7c
children d2bfadc2948b
comparison
equal deleted inserted replaced
4406:4cb9f66a1c7c 4407:2412601cd24b
2189 } 2189 }
2190 2190
2191 2191
2192 static void ExtractPdf(RestApiGetCall& call) 2192 static void ExtractPdf(RestApiGetCall& call)
2193 { 2193 {
2194 if (call.IsDocumentation())
2195 {
2196 call.GetDocumentation()
2197 .SetTag("Instances")
2198 .SetSummary("Get embedded PDF")
2199 .SetDescription("Get the PDF file that is embedded in one DICOM instance. "
2200 "If the DICOM instance doesn't contain the `EncapsulatedDocument` tag or if the "
2201 "`MIMETypeOfEncapsulatedDocument` tag doesn't correspond to the PDF type, a `404` HTTP error is raised.")
2202 .SetUriArgument("id", "Orthanc identifier of the instance interest")
2203 .AddAnswerType(MimeType_Pdf, "PDF file");
2204 return;
2205 }
2206
2194 const std::string id = call.GetUriComponent("id", ""); 2207 const std::string id = call.GetUriComponent("id", "");
2195
2196 std::string pdf; 2208 std::string pdf;
2197 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id); 2209 ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);
2198 2210
2199 if (locker.GetDicom().ExtractPdf(pdf)) 2211 if (locker.GetDicom().ExtractPdf(pdf))
2200 { 2212 {