# HG changeset patch # User Sebastien Jodogne # Date 1608828292 -3600 # Node ID 2412601cd24bc9a6e021e6966e8ea441d35bbb6e # Parent 4cb9f66a1c7ce2a62a95a3bb496c8b49b7ce82eb cont openapi diff -r 4cb9f66a1c7c -r 2412601cd24b OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Thu Dec 24 17:32:19 2020 +0100 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Thu Dec 24 17:44:52 2020 +0100 @@ -2191,8 +2191,20 @@ static void ExtractPdf(RestApiGetCall& call) { + if (call.IsDocumentation()) + { + call.GetDocumentation() + .SetTag("Instances") + .SetSummary("Get embedded PDF") + .SetDescription("Get the PDF file that is embedded in one DICOM instance. " + "If the DICOM instance doesn't contain the `EncapsulatedDocument` tag or if the " + "`MIMETypeOfEncapsulatedDocument` tag doesn't correspond to the PDF type, a `404` HTTP error is raised.") + .SetUriArgument("id", "Orthanc identifier of the instance interest") + .AddAnswerType(MimeType_Pdf, "PDF file"); + return; + } + const std::string id = call.GetUriComponent("id", ""); - std::string pdf; ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);