{"id":8991,"date":"2024-08-30T21:16:10","date_gmt":"2024-08-30T15:46:10","guid":{"rendered":"https:\/\/www.satup.xyz\/index.php\/2024\/08\/30\/adobe-acrobat-services-sdks-updated-and-revised-by-raymond-camden-aug-2024\/"},"modified":"2024-08-30T21:16:10","modified_gmt":"2024-08-30T15:46:10","slug":"adobe-acrobat-services-sdks-updated-and-revised-by-raymond-camden-aug-2024","status":"publish","type":"post","link":"https:\/\/www.satup.xyz\/index.php\/2024\/08\/30\/adobe-acrobat-services-sdks-updated-and-revised-by-raymond-camden-aug-2024\/","title":{"rendered":"Adobe Acrobat Services SDKs Updated and Revised | by Raymond Camden | Aug, 2024"},"content":{"rendered":"<p><br \/>\n<\/p>\n<div>\n<div>\n<div>\n<div class=\"speechify-ignore ab cp\">\n<div class=\"speechify-ignore bh l\">\n<div class=\"hv hw hx hy hz ab\">\n<div>\n<div class=\"ab ia\"><a href=\"https:\/\/medium.com\/@cfjedimaster?source=post_page-----93e023e0d4b0--------------------------------\" rel=\"noopener follow\"><\/p>\n<div>\n<div class=\"bm\" aria-hidden=\"false\">\n<div class=\"l ib ic by id ie\">\n<div class=\"l fj\"><img loading=\"lazy\" decoding=\"async\" alt=\"Raymond Camden\" class=\"l fd by dd de cx\" src=\"https:\/\/miro.medium.com\/v2\/resize:fill:88:88\/1*ldF-FsLonNyTUOmQ7cIV_g.jpeg\" width=\"44\" height=\"44\" loading=\"lazy\" data-testid=\"authorPhoto\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/a><a href=\"https:\/\/blog.developer.adobe.com\/?source=post_page-----93e023e0d4b0--------------------------------\" rel=\"noopener  ugc nofollow\"><\/p>\n<div class=\"ih ab fj\">\n<div>\n<div class=\"bm\" aria-hidden=\"false\">\n<div class=\"l ii ij by id ik\">\n<div class=\"l fj\"><img loading=\"lazy\" decoding=\"async\" alt=\"Adobe Tech Blog\" class=\"l fd by br il cx\" src=\"https:\/\/miro.medium.com\/v2\/resize:fill:48:48\/1*riyFijvwTfGcWNf1guRNtg.png\" width=\"24\" height=\"24\" loading=\"lazy\" data-testid=\"publicationPhoto\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<figure class=\"na nb nc nd ne nf mx my paragraph-image\">\n<div class=\"mx my mz\"><picture><source srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1200\/format:webp\/1*uFAYOoxdz4AN5cHcOnOCdw.png 1200w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 600px\" type=\"image\/webp\"\/><source data-testid=\"og\" srcset=\"https:\/\/miro.medium.com\/v2\/resize:fit:640\/1*uFAYOoxdz4AN5cHcOnOCdw.png 640w, https:\/\/miro.medium.com\/v2\/resize:fit:720\/1*uFAYOoxdz4AN5cHcOnOCdw.png 720w, https:\/\/miro.medium.com\/v2\/resize:fit:750\/1*uFAYOoxdz4AN5cHcOnOCdw.png 750w, https:\/\/miro.medium.com\/v2\/resize:fit:786\/1*uFAYOoxdz4AN5cHcOnOCdw.png 786w, https:\/\/miro.medium.com\/v2\/resize:fit:828\/1*uFAYOoxdz4AN5cHcOnOCdw.png 828w, https:\/\/miro.medium.com\/v2\/resize:fit:1100\/1*uFAYOoxdz4AN5cHcOnOCdw.png 1100w, https:\/\/miro.medium.com\/v2\/resize:fit:1200\/1*uFAYOoxdz4AN5cHcOnOCdw.png 1200w\" sizes=\"(min-resolution: 4dppx) and (max-width: 700px) 50vw, (-webkit-min-device-pixel-ratio: 4) and (max-width: 700px) 50vw, (min-resolution: 3dppx) and (max-width: 700px) 67vw, (-webkit-min-device-pixel-ratio: 3) and (max-width: 700px) 65vw, (min-resolution: 2.5dppx) and (max-width: 700px) 80vw, (-webkit-min-device-pixel-ratio: 2.5) and (max-width: 700px) 80vw, (min-resolution: 2dppx) and (max-width: 700px) 100vw, (-webkit-min-device-pixel-ratio: 2) and (max-width: 700px) 100vw, 600px\"\/><img fetchpriority=\"high\" alt=\"\" class=\"bh me ng c\" width=\"600\" height=\"400\" loading=\"eager\" role=\"presentation\"\/><\/picture><\/div>\n<\/figure>\n<p id=\"de18\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Over the past few months, we\u2019ve been working to improve and expand the power of our SDKs and with the most recent update to our .NET SDK, we\u2019ve now completed the overhaul of all our supported platforms. These 4.x versions offer improved support for our <a class=\"af of\" href=\"https:\/\/developer.adobe.com\/document-services\/docs\/apis\/\" rel=\"noopener ugc nofollow\" target=\"_blank\">REST APIs<\/a> and will be much more flexible than earlier versions. Let\u2019s cover the updates.<\/p>\n<p id=\"5c34\" class=\"pw-post-body-paragraph nh ni gu nj b nk pe nm nn no pf nq nr ns pg nu nv nw ph ny nz oa pi oc od oe gn bk\">At a high level, the new SDKs offer better support for the asynchronous nature of our APIs. Previously, SDK methods \u2018hid\u2019 the async nature behind the scenes, which while perhaps simpler, meant that developers had less control over the process. Now SDK users can choose how they want to handle this aspect of their development.<\/p>\n<p id=\"1925\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Next, our Python SDK now has full support for all our released APIs. Previously, Python only supported a subset of the features.<\/p>\n<p id=\"d550\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Finally, asset deletion is now supported via the SDK. When your code uploads a document, for example, a Word doc that will be converted to PDF, Adobe keeps this file in a secure temporary storage system. While no one had access to this asset, it\u2019s understandable that you may wish to remove this asset as soon as the conversion is done. The REST API has supported this for some time, but now the SDKs do as well.<\/p>\n<p id=\"6789\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Let\u2019s take a look at how these new SDKs work. If you want to try these examples yourself, be sure to <a class=\"af of\" href=\"https:\/\/acrobatservices.adobe.com\/dc-integration-creation-app-cdn\/main.html\" rel=\"noopener ugc nofollow\" target=\"_blank\">grab your own free credentials<\/a>.<\/p>\n<p id=\"1c02\" class=\"pw-post-body-paragraph nh ni gu nj b nk pe nm nn no pf nq nr ns pg nu nv nw ph ny nz oa pi oc od oe gn bk\">We\u2019ll start with the simplest example, converting a Word document to PDF. For this demo, we\u2019ll make use of the Node SDK which can be installed via <code class=\"cx pj pk pl pm b\">npm<\/code>:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"1854\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Ok, now let\u2019s look at the code. First, our imports:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"d5e8\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">The SDK has specific types based on the operation being used and you can see that above with <code class=\"cx pj pk pl pm b\">CreatePDFJob<\/code> and <code class=\"cx pj pk pl pm b\">CreatePDFResult<\/code>. FYI, the SDKs have full documentation as well of course. You can find the Node SDK docs here: <a class=\"af of\" href=\"https:\/\/opensource.adobe.com\/pdfservices-node-sdk-samples\/apidocs\/latest\/index.html\" rel=\"noopener ugc nofollow\" target=\"_blank\">https:\/\/opensource.adobe.com\/pdfservices-node-sdk-samples\/apidocs\/latest\/index.html<\/a><\/p>\n<p id=\"0d6a\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Next, we set up our credentials by reading our values from the environment. These credentials are then passed to an instance of the <code class=\"cx pj pk pl pm b\">PDFServices<\/code> object.<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"5d25\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Now we define our operation. In this simple case, we don\u2019t have to tweak any of the parameters, just supply the input. This is done using <code class=\"cx pj pk pl pm b\">fs<\/code> streams and defining our mime type. If you&#8217;ve ever found yourself Googling for the precise mime type of Office docs, you&#8217;ll appreciate having them baked into the SDK itself. We create the job and use <code class=\"cx pj pk pl pm b\">submit<\/code> to get it running.<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"be39\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Finally, you can poll for the result, and if successful, stream down the bits:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"8556\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">All in all, fairly short and sweet for a simple use case. Here\u2019s the entire script, with a bit more logging in that provides additional feedback while it runs:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"4bd4\" class=\"pw-post-body-paragraph nh ni gu nj b nk pe nm nn no pf nq nr ns pg nu nv nw ph ny nz oa pi oc od oe gn bk\">One of the largest benefits of the SDKs is that they enable greater performance by enabling you to chain one command after another. Imagine you wanted to convert the Word doc into a PDF <em class=\"pv\">and<\/em> add a password. Previously this would have required the SDK to:<\/p>\n<ul class=\"\">\n<li id=\"a685\" class=\"nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe pw px py bk\">Upload the Word doc<\/li>\n<li id=\"e9d5\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Download the PDF<\/li>\n<li id=\"98f3\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Upload the PDF<\/li>\n<li id=\"fe43\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Download the protected PDF<\/li>\n<\/ul>\n<p id=\"840b\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Now the SDKs can simply refer to the output of a previous action by using the resulting asset as input for the next operation. Let\u2019s look at what\u2019s necessary for that.<\/p>\n<p id=\"9564\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">First, we add in the required support for our password-protect action. This (and the following updates) all came from our docs which include updated instructions for the new SDKs: <a class=\"af of\" href=\"https:\/\/developer.adobe.com\/document-services\/docs\/overview\/pdf-services-api\/howtos\/protect-pdf\/\" rel=\"noopener ugc nofollow\" target=\"_blank\">Protect PDF<\/a><\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"d005\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">In the code snippet above, we\u2019ve added: <code class=\"cx pj pk pl pm b\">ProtectPDFParams<\/code>, <code class=\"cx pj pk pl pm b\">EncryptionAlgorithm<\/code>, <code class=\"cx pj pk pl pm b\">ProtectPDFJob<\/code>, <code class=\"cx pj pk pl pm b\">ProtectPDFResult<\/code>.<\/p>\n<p id=\"a4bd\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Now, let\u2019s begin our modification. The line that waited for the result of the Create PDF operation was:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"393d\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Everything that follows is after that line. First, we\u2019ll specify the params for the operation, in this case, a hard coded password:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"e7c5\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Next, we make our job, using the result asset from the CreatePDF job:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"7aee\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">The remainder of the code is as before \u2014 poll the job, and when done, get the asset and stream it (note that we\u2019ve modified the file name):<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"c192\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">And that\u2019s it. In theory, there is no limit to what you could chain. You could:<\/p>\n<ul class=\"\">\n<li id=\"abe7\" class=\"nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe pw px py bk\">Convert to PDF<\/li>\n<li id=\"0a43\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Prepend a title page for the document<\/li>\n<li id=\"937b\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Add a watermark<\/li>\n<li id=\"64d2\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Seal the document<\/li>\n<li id=\"033a\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">Password protect it<\/li>\n<li id=\"85e8\" class=\"nh ni gu nj b nk pz nm nn no qa nq nr ns qb nu nv nw qc ny nz oa qd oc od oe pw px py bk\">And then download it.<\/li>\n<\/ul>\n<p id=\"5d3c\" class=\"pw-post-body-paragraph nh ni gu nj b nk nl nm nn no np nq nr ns nt nu nv nw nx ny nz oa ob oc od oe gn bk\">Here\u2019s the complete version of this script:<\/p>\n<figure class=\"pn po pp pq pr nf\"\/>\n<p id=\"c17e\" class=\"pw-post-body-paragraph nh ni gu nj b nk pe nm nn no pf nq nr ns pg nu nv nw ph ny nz oa pi oc od oe gn bk\">To get started, sign up for <a class=\"af of\" href=\"https:\/\/acrobatservices.adobe.com\/dc-integration-creation-app-cdn\/main.html?api=pdf-services-api\" rel=\"noopener ugc nofollow\" target=\"_blank\">free credentials<\/a> and give the SDKs a try. If you\u2019re using a language not supported by the SDKs, or simply would rather use the APIs, peruse the <a class=\"af of\" href=\"https:\/\/developer.adobe.com\/document-services\/docs\/apis\/\" rel=\"noopener ugc nofollow\" target=\"_blank\">API docs<\/a> for more information.<\/p>\n<\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.developer.adobe.com\/adobe-acrobat-services-sdks-updated-and-revised-93e023e0d4b0?source=rss----9342990108af---4\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the past few months, we\u2019ve been working to improve and expand the power of our SDKs and with the most recent update to our .NET SDK, we\u2019ve now completed the overhaul of all our supported platforms. These 4.x versions offer improved support for our REST APIs and will be much more flexible than earlier [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8992,"comment_status":"","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-8991","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-graphics-design"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/posts\/8991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=8991"}],"version-history":[{"count":0,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/posts\/8991\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/media\/8992"}],"wp:attachment":[{"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=8991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=8991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.satup.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=8991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}