{"id":589,"date":"2011-09-14T06:58:54","date_gmt":"2011-09-14T13:58:54","guid":{"rendered":"http:\/\/www.quickpdflibrary.com\/blog\/?p=589"},"modified":"2011-09-14T06:58:54","modified_gmt":"2011-09-14T13:58:54","slug":"quick-pdf-library-8-api-changes","status":"publish","type":"post","link":"https:\/\/www.quickpdflibrary.com\/blog\/2011\/09\/quick-pdf-library-8-api-changes\/","title":{"rendered":"Quick PDF Library 8 API Changes"},"content":{"rendered":"<p>Quick PDF Library 8 is a major new version of Quick PDF Library and contains a few changes to the API that were necessary to provide native support for Unicode and to improve the way secured PDF files are handled by the library. We also took this opportunity to rename some functions which used terms that\u00a0conflicted\u00a0with terms used by Acrobat.<\/p>\n<p>This document contains a list of items that developers looking to upgrade to Quick PDF Library 8 should pay attention to. Changes to code may be required in order for your projects to compile using the new version.<\/p>\n<h3 class=\"c0\"><a name=\"h.b300t2z4dcnd\"><\/a><span class=\"c11\">1. Changed functions definitions<\/span><\/h3>\n<ul class=\"c15\">\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">LoadFromFile<\/span><span>, <\/span><span class=\"c3\">LoadFromString<\/span><span>, <\/span><span class=\"c3\">LoadFromVariant<\/span><span>\u00a0and <\/span><span class=\"c3\">LoadFromStream<\/span><span>\u00a0functions now have a <\/span><span class=\"c3\">Password<\/span><span>\u00a0parameter. Note functionality changes below.<\/span><\/li>\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">ExtractFilePages<\/span><span>\u00a0and <\/span><span class=\"c3\">GetFileMetadata<\/span><span>\u00a0functions now have a <\/span><span class=\"c3\">Password<\/span><span>\u00a0parameter.<\/span><\/li>\n<li class=\"c2 c0\"><span>All functions that previously returned or accepted 8-bit character strings (either UTF-8 encoded, WinAnsi encoding or unspecified encoding) now use UTF-16 Unicode strings.<\/span><\/li>\n<li class=\"c0 c2\"><span>Certain functions continue to accept or return 8-bit data, others have been renamed to more easily facilitate working with binary data.<\/span><\/li>\n<li class=\"c2 c0\"><span>All the text drawing functions (such as <\/span><span class=\"c3\">DrawText<\/span><span>, <\/span><span class=\"c3\">DrawHTMLText<\/span><span>) allow the text to be specified using UTF-16 Unicode strings. The fonts automatically convert the text string\u2019s Unicode characters to the appropriate encoding for storing in the content stream.<\/span><\/li>\n<\/ul>\n<h3 class=\"c0\"><a name=\"h.b300t2z4dcnd\"><\/a><span class=\"c11\">2. <\/span><span class=\"c11\">Renamed functions<\/span><\/h3>\n<ul class=\"c15\">\n<li class=\"c2 c0\"><span>The fullowing functions have been renamed due to the changes from 8-bit to 16-bit strings. The change results in two new functions to replace each original function:<\/span><\/li>\n<\/ul>\n<table style=\"margin-left: auto; margin-right: auto;\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">GetObjectSource<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>GetObjectToString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>GetObjectToVariant (ActiveX)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">SetObjectSource<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>SetObjectFromString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>SetObjectFromVariant (ActiveX)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">GetPageContent<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>GetPageContentToString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>GetPageContentToVariant (ActiveX)<\/span><\/p>\n<p class=\"c0\"><span>* Note functionality changes listed below<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">SetPageContent<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>SetPageContentFromString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>SetPageContentFromVariant (ActiveX)<\/span><\/p>\n<p class=\"c0\"><span>* Note functionality changes listed below<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">DAGetPageContent<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>DAGetPageContentToString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>DAGetPageContentToVariant (ActiveX)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">DAGetObjectSource<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>DAGetObjectToString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>DAGetObjectToVariant (ActiveX)<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td class=\"c12\">\n<p class=\"c0\"><span class=\"c3\">ExtractFilePageContent<\/span><\/p>\n<\/td>\n<td class=\"c5\">\n<p class=\"c0\"><span>ExtractFilePageContentToString (Delphi and DLL)<\/span><\/p>\n<p class=\"c0\"><span>ExtractFilePageContentToVariant (ActiveX)<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul class=\"c15\">\n<li class=\"c0 c17\"><span>In QPL v7 the term \u201clayer\u201d was used to describe a part of a page\u2019s content stream. This conflicted with Adobe\u2019s use of the term \u201clayer\u201d for the PDF feature known as optional content groups. To avoid confusion, all the layer functions have been renamed:<\/span><\/li>\n<\/ul>\n<table class=\"c10\" style=\"margin-left: auto; margin-right: auto;\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">SetLayerOptional<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>SetContentStreamOptional<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">LayerCount<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>ContentStreamCount<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">CombineLayers<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>CombineContentStreams<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">NewLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>NewContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">SelectLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>SelectContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">EditableLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>EditableContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">MoveLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>MoveContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">DeleteLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>DeleteContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">LayerSafe<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>ContentStreamSafe<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">UseUnsafeLayers<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>UseUnsafeContentStreams<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">EncapsulateLayer<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0 c9\"><span>EncapsulateContentStream<\/span><\/p>\n<\/td>\n<\/tr>\n<tr class=\"c1\">\n<td class=\"c12\">\n<p class=\"c0 c9\"><span class=\"c3\">RemoveSharedLayers<\/span><\/p>\n<\/td>\n<td class=\"c6\">\n<p class=\"c0\"><span>RemoveSharedContentStreams<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 class=\"c0\"><a name=\"h.b300t2z4dcnd\"><\/a><span class=\"c11\">3. New functions<\/span><\/h3>\n<ul class=\"c15\">\n<li class=\"c2 c0\"><span class=\"c3\">GetContentStreamToString<\/span><span>\u00a0and <\/span><span class=\"c3\">GetContentStreamToVariant<\/span><span>\u00a0have been added to replace the functionality previously provided by the <\/span><span class=\"c3\">GetPageContent <\/span><span>function.<\/span><\/li>\n<li class=\"c2 c0\"><span class=\"c3\">SetContentStreamFromString<\/span><span>\u00a0and <\/span><span class=\"c3\">SetContentStreamFromVariant<\/span><span>\u00a0have been added to replace the functionality previously provided by the <\/span><span class=\"c3\">SetPageContent <\/span><span>function.<\/span><\/li>\n<li class=\"c2 c0\"><span class=\"c3\">SetTextExtractionOptions<\/span><span>\u00a0was added to provide greater contrul over the text extraction functions.<\/span><\/li>\n<li class=\"c2 c0\"><span class=\"c3\">CheckFileCompliance<\/span><span>\u00a0was added to check for PDF\/A compliance along with the <\/span><span class=\"c3\">GetStringListCount<\/span><span>, <\/span><span class=\"c3\">GetStringListItem<\/span><span>\u00a0functions needed to retrieve the compliance test results.<\/span><\/li>\n<li class=\"c2 c0\"><span class=\"c3\">SetPDFAMode<\/span><span>\u00a0was added to allow the creation of new PDF\/A-1b compliant documents.<\/span><\/li>\n<li class=\"c2 c0\"><span>Other new functions include <\/span><span class=\"c3\">DrawPDF417Symbul<\/span><span>, <\/span><span class=\"c3\">AddTrueTypeSubsettedFont<\/span><span>, <\/span><span class=\"c3\">SetLineDashEx<\/span><span>\u00a0and <\/span><span class=\"c3\">SetRenderCropType<\/span><span>.<\/span><\/li>\n<\/ul>\n<h3 class=\"c0\"><a name=\"h.b300t2z4dcnd\"><\/a><span class=\"c11\">4. Removed functions<\/span><\/h3>\n<ul class=\"c15\">\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">SetAdvancePassword<\/span><span>\u00a0and <\/span><span class=\"c3\">SetPassword<\/span><span>\u00a0functions have been removed. They are no longer necessary because the <\/span><span class=\"c3\">LoadFrom*<\/span><span>\u00a0functions now have an additional parameter for specifying the password.<\/span><\/li>\n<\/ul>\n<h3 class=\"c0\"><a name=\"h.b300t2z4dcnd\"><\/a><span class=\"c11\">5. Changed functionality<\/span><\/h3>\n<ul class=\"c15\">\n<li class=\"c2 c0\"><span>When the <\/span><span class=\"c3\">LoadFrom<\/span><span>* functions are used to open an encrypted document the objects will be automatically decrypted as necessary. Calls to <\/span><span class=\"c3\">SetPassword<\/span><span>, <\/span><span class=\"c3\">SetAdvancePassword<\/span><span>\u00a0and <\/span><span class=\"c3\">Decrypt<\/span><span>\u00a0are no longer necessary to access any parts of an encrypted document. The <\/span><span class=\"c3\">SaveTo<\/span><span>* functions can be used to save an encrypted document and the original encryption will remain in place with any new content automatically encrypted to the existing security settings.<\/span><\/li>\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">LoadFrom<\/span><span>* functions now return 1 on success and 0 on failure. In QPL v7 these functions would return 2 if an encrypted document made use of object streams or cross reference streams. This is no longer necessary as these functions have a new password parameter. If the wrong password is given, the <\/span><span class=\"c3\">LoadFrom<\/span><span>* functions will return 0 and the <\/span><span class=\"c3\">LastErrorCode<\/span><span>\u00a0function will return error code 404.<\/span><\/li>\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">Encrypt<\/span><span>\u00a0and <\/span><span class=\"c3\">Decrypt<\/span><span>\u00a0functions can still be used to add or remove security and full access to the document is possible even after encryption has been applied.<\/span><\/li>\n<li class=\"c2 c0\"><span>In QPL v7, the <\/span><span class=\"c3\">GetPageContent <\/span><span>function returned only a portion of the page\u2019s content stream. The replacement functions <\/span><span class=\"c3\">GetPageContentToString<\/span><span>\u00a0and <\/span><span class=\"c3\">GetPageContentToVariant <\/span><span>now return the entire content stream of the selected page, not just an individual part.<\/span><\/li>\n<li class=\"c2 c0\"><span>Similarly, the <\/span><span class=\"c3\">SetPageContentFromString<\/span><span>\u00a0and <\/span><span class=\"c3\">SetPageContentFromVariant<\/span><span>\u00a0functions now set the entire content stream of the selected page, not just an individual part.<\/span><\/li>\n<li class=\"c2 c0\"><span>The <\/span><span class=\"c3\">SecurityInfo<\/span><span>\u00a0function returns the active encryption details even though encrypted object in documents are internally decrypted as needed.<\/span><\/li>\n<li class=\"c2 c0\"><span>XMP metadata is now added to new documents and maintained in existing documents. Calling functions like <\/span><span class=\"c3\">SetInformation<\/span><span>\u00a0will result in the XMP metadata being updated to keep that particular item in the document information dictionary in sync.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick PDF Library 8 is a major new version of Quick PDF Library and contains a few changes to the API that were necessary to provide native support for Unicode and to improve the way secured PDF files are handled by the library. We also took this opportunity to rename some functions which used terms [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,6],"tags":[269,20,223,211],"class_list":["post-589","post","type-post","status-publish","format-standard","hentry","category-quick-pdf-library","category-tips-and-tutorials","tag-quick-pdf-library","tag-quick-pdf","tag-upgrade-instructions","tag-version-8"],"_links":{"self":[{"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/posts\/589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/comments?post=589"}],"version-history":[{"count":10,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/posts\/589\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/posts\/589\/revisions\/599"}],"wp:attachment":[{"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/media?parent=589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/categories?post=589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickpdflibrary.com\/blog\/wp-json\/wp\/v2\/tags?post=589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}