عمليات المستند عبر JSON وC ABI
export.structured exports selected pages as semantic HTML, XHTML, XML, or JSON; tables.export exports typed tables as CSV, JSON, or XLSX, retaining cross-page continuity, merged cells, and native value inference
كلتا العمليتين تتطلبان وجهة إخراج ثنائية وتحفظان المستند وحقول التوقيع القائمة وتُتيحان خيارات تصدير أصلية محدودة بحدود
التصدير البنيوي والجداول الموسومة
{"schemaVersion":1,"type":"export.structured","pages":[0,1],"format":"html",
"options":{"imageMode":"metadata","includeFormControls":false}}
{"schemaVersion":1,"type":"tables.export","pages":[0,1],"format":"json",
"options":{"mergeAcrossPages":true,"dateOrder":"dmy",
"decimalSeparator":",","thousandsSeparator":"."}}
Structured export accepts html, xhtml, xml, and json (default); table export accepts csv (default), json, and xlsx
Structured Boolean options are includeCoordinates, includeStyles, includeImages, includeTables, includeAccessibilitySemantics, preferTaggedStructure, fallbackToGeometricSemantics, includeNavigation, includeAnnotations, and includeFormControls; all default to true
imageMode accepts omit, metadata, and embedded-png (default); see تصدير الصفحات المحملة البنيوي للنموذج الدلالي وسلوك الحقول الحساسة
Structured resource options are maxPageCount, maxGlyphsPerPage, maxImagesPerPage, maxStructureNodes, maxOutlineItems, maxInteractionsPerPage, maxFormOptionsPerField, maxOutputBytes, maxImageBytes, and maxTotalImageBytes
Table Boolean options are detectMergedCells, detectRepeatedHeaders, mergeAcrossPages, and inferValueTypes; all default to true
dateOrder accepts ymd (default), mdy, and dmy; separators must be individual printable characters, with an empty thousandsSeparator disabling it
minimumTableConfidence accepts 0 through 1 and defaults to 0.55; positive columnTolerance defaults to 12 page units
Table resource options are maxPageCount, maxGlyphsPerPage, maxTableCount, maxRowCount, maxCellCount, maxTextCharacters, and maxOutputBytes; see استخلاص الجداول الموسومة لنموذج الخلايا
أسماء الخيارات المجهولة والأنواع الخاطئة والصيغ غير المدعومة والحدود غير الموجبة تُرفض؛ والحدود الأصلية المطلوبة تُسقف بميزانيات ذاكرة وكائنات محافظة
Export staging is capped at the smaller of budget.outputBytes and one quarter of budget.memoryBytes; effectiveOutputLimit reports that cap, while tighter options.maxOutputBytes may apply
Native resource failures report budget-exceeded, metric nativeExportResources, and the native diagnostic; observed=1 and limit=0 denote a denied resource condition rather than measured byte usage
Both operations report documentUpdated: false, preserve source auto-launch and decode settings, stage output before publication, and retain existing file destinations after a failed file job
فحوص إلغاء المهلة وcallback ABI تعاونية عند نقاط فحص العملية والنشر؛ ورموز الإلغاء الأصلية تنطبق أيضًا داخل مراحل الاستخلاص المدعومة، والعمل الأصلي لا يُقاطع قسرًا
THPDFJobProcessor.ExecuteLoadedOperation and hpdf_document_execute_json_v1 share the same schema-versioned document operation engine
Discover the current operation names, formats, signing profile, callback behavior, and default budgets with THPDFJobProcessor.Capabilities or hpdf_capabilities_json_to_io
العمليات
Operation JSON uses UTF-8 and schemaVersion: 1; page indices are zero-based and selected page arrays cannot contain duplicates
| النوع | الإدخال | النتيجة |
|---|---|---|
| info | مستند محمل | عدادات الصفحات والكائنات والنماذج وحقول التوقيع |
| render | page وdpi (18–1,200) وformat (png) | مصنوع PNG وأبعاده |
| export.structured | pages وformat وoptions | مصنوع HTML/XHTML/XML/JSON دلالي وقياسات التصدير |
| tables.export | pages وformat وoptions | مصنوع CSV/JSON/XLSX موسوم وقياسات الجداول/الخلايا/الرؤوس |
| text.extract | pages وlayout اختياري | نص صفحة Unicode ومصنوع نص UTF-8 اختياري |
| text.replace | pages وneedle وreplacement وmatchCase | عدادات المطابقة/الاستبدال/التخطي لكل صفحة ومصنوع PDF اختياري |
| forms.read | مستند محمل | الأسماء والقيم المفكوكة من Unicode وأنواع الحقول الأصلية |
| forms.fill | مصفوفة fields بسلاسل اسم/قيمة | تحديثات ذرية؛ والأسماء المجهولة أو المكررة ترفض العملية |
| forms.flatten | مستند محمل | عدد المسطَّح والحقول المتبقية |
| ocr.layer | pages وengine وengineOptions وdpi وminimumConfidence وskipPagesWithText وreplaceExisting | PDF قابل للبحث عبر محرك ASCII المدمج أو مهايئات Tesseract/RapidOCR المحلية، مع عدادات كلمات مقبولة/مسقطة |
| redact | burnIn بقيمة true ومستطيلات بـ page/x1/y1/x2/y2 | عدد redaction المطبقة ومصنوع PDF |
| sign | pfxFile وpfxPassword وpage وfieldName ومستطيل وcontentsBytes اختياريان | مصنوع PDF موقعةً بـ PFX بملف غير موقعة أو تزايدي |
| archive.pdfa4.raster | acceptInformationLoss بقيمة true وiccProfileFile وdpi وoptions اختيارية | مصنوع PDF/A-4 نقطي مفحوص وعدادات إزالة وملف خسارة صريح؛ ويحفظ المصدر المحمل |
استبدال النص يعيد حالة جزئية عندما لا تستطيع واجهة الاستبدال الأصلية ترميز مطابقة؛ وافحص عداداتها لكل صفحة
مهام OCR الخارجية تقبل محركات Tesseract CLI/DLL وRapidOCR CLI/DLL مهيأةً صراحةً بجوار الافتراضي ASCII المدمج، بإعدادات موسومة ومهل محركات وسقوف بكسل ونشر ذري
التغييرات ترفض المستندات ذات حقول توقيع قائمة، بما يشمل العناصر النائبة غير الموقعة؛ واستخدم ملف التوقيع التزايدي أو واجهات التزايدي الأصلية لحفظ التوقيعات في تلك المستندات
التوقيع التزايدي بـ PFX تقبل مصدرًا محتفظًا غير متغير، بما يشمل PDFs مشفرة مدعومة بكلمة سر عملية صريحة، وتفحص كل CMS قديمًا وجديدًا وتحفظ البايتات الأصلية والتشفير وتدعم حقلًا فارغًا قائمًا وتفحص صلاحيات التشفير وترفض أسماء مصدر/إخراج الملفات البديلة
Signing produces a signed artifact and restores the original handle, reporting documentUpdated: false; existing form fields remain available, temporary signature fields are removed, and the handle can be queried or used for another operation after signing
التحويل الأرشيفي النقطي إلى PDF/A-4
{
"schemaVersion": 1,
"type": "archive.pdfa4.raster",
"acceptInformationLoss": true,
"iccProfileFile": "profiles/sRGB.icm",
"dpi": 150,
"input": "source.pdf",
"output": "archive.pdf"
}
Place this object in a file job's operations array, or supply it directly through hpdf_document_execute_json_v1 with a loaded handle and binary output callbacks; the C ABI ignores file-job input/output paths and uses its adapters
acceptInformationLoss must be the JSON Boolean true, and iccProfileFile must name a nonempty, NUL-free path to a supported sRGB matrix/TRC ICC profile on the execution host; relative profile paths resolve against the process working directory
dpi defaults to 150 and accepts integers from 36 through 1,200; conversion covers every source page and rejects any pages member
The archive result object reports nativeValidationSucceeded, sourcePages, pagesRendered, rasterPixels, outputBytes, removedAnnotations, removedFormFields, and removedEmbeddedFiles
archive.lossy is true, and every flag in archive.lossProfile is false: searchableText, vectorContent, interactiveContent, originalSignatures, annotationAppearances, and structureIdentity
Page content becomes RGB pixels; annotations and widget appearances are omitted, and original signatures are not carried into the output; the loaded source remains available with documentUpdated: false, including after failed publication; its prior launch, decode, stream-threshold, cancellation, and render settings are restored
إخراج ثنائي مطلوب، ويجب أن ينجح التحقق الأصلي PDF/A-4 قبل التسليم. ولمعالجة حدود التصيير واللون والمرماز وأسماء المصدر البديلة والتوافق، راجع تحويل PDF/A-4 النقطي للمستندات المحملة
ميزانيات الموارد الأرشيفية
The optional options object accepts positive exact integers that tighten the following effective caps; unknown keys and values exceeding a cap reject the request rather than increasing the operation budget
| الخيار | الافتراضي والحد الأقصى الفعالان |
|---|---|
| maxPages | الأدنى بين 1,000 وbudget.pageCount |
| maxInputObjects | الأدنى بين 200,000 وbudget.objectCount |
| maxPixelsPerPage | الأدنى بين 40,000,000 وbudget.pixels وmemoryBytes / 32 |
| maxTotalPixels | الأدنى بين 500,000,000 وbudget.pixels وmemoryBytes / 32 |
| maxRasterBytes | الأدنى بين 256 MiB وmemoryBytes / 8 |
| maxOutputBytes | الأدنى بين 256 MiB وbudget.outputBytes وmemoryBytes / 8 |
| maxDecodedStreamBytes | الأدنى بين 64 MiB وmemoryBytes / 8 |
| maxTotalDecodedBytes | الأدنى بين 256 MiB وmemoryBytes / 4 |
ملف ICC يُسقف بالأصغر بين 4 MiB وmemoryBytes / 16 قبل الحجز؛ وهذه العُدد المحافظة تحسب stagingًا متزامنًا ومخازن إخراج وبيانات صور وعمل فاك، ولا تثبت حدًا صارمًا لـ RSS العملية
زد ميزانيات المهمة العلوية عندما يكون حمل أرشفة أكبر مقصودًا؛ والخيارات المتداخلة تشدّد السقوف الفعالة فقط، والأقصيات الأصلية ما تزال تنطبق
نقاط فحص الأرشفة تستجلب إلغاء callback ورمز إلغاء المصدر المستعار والزمن المنقضي وعدادات الكائنات أثناء التحويل. وفشول الميزانية والإلغاء يحفظان رموز حالتهما البنيوية عبر المحول الأصلي
مهام الملفات
{
"operations": [
{"type": "capabilities"},
{"schemaVersion": 1, "type": "text.extract", "input": "input.pdf",
"pages": [0, 1], "output": "text.txt"}
]
}
THPDFJobProcessor.Execute accepts an operations array, up to 1,024 operations and 4 MiB of JSON; existing merge, split, optimise, encrypt, and validate jobs remain available
كل عملية مستند تزود مسار إدخال وكلمة سر اختيارية؛ وrender وtext.replace وforms.fill وforms.flatten وocr.layer وredact وsign وarchive.pdfa4.raster تتطلب مسار إخراج
المصنوعات تُكتب إلى ملف مؤقت بجوار الوجهة وتُدفَع وتُفحص ثم تُنشر ذريًا؛ والفشل يحفظ وجهة قائمة وقد يتقاسم الإدخال/الإخراج مسارًا
عقد callback C
Zero-initialize hpdf_operation_v1, set struct_size to its native size, abi_version to HPDF_ABI_VERSION_1, and flags to zero; compare its size with hpdf_abi_operation_v1_size
سجل العملية يحمل بايتات JSON وطولًا دقيقًا وإدخال وصول عشوائي اختياريًا وإخراجًا ثنائيًا تسلسليًا اختياريًا وإخراجًا إلزاميًا لنتيجة JSON تسلسليًا
callbacks الإدخال وبيانات المستخدم وبايتات PDF الأساسية يجب أن تبقى صالحة حتى يُستبدل المقبض أو يُتلف، لأن التحليل البكسل يحتفظ بالمهايئ
callbacks الإخراج/النتيجة موجودة فقط أثناء الاستدعاء؛ وسلّسِل الاستدعاءات لكل مقبض وتجنب إعادة دخول callback
callbacks تستخدم cdecl وتُعاد محاولات النقل الجزئية والكتابات الناجحة يجب أن تحقق تقدمًا موجبًا؛ والاستثناءات تتحول إلى رموز حالة ثابتة
التغييرات تلتزم فقط بعد نجاح تسليم المصنوع ونتيجة JSON كليهما؛ وفشل callback أو الإلغاء يتراجع عن التغييرات والمستدعون يهملون أي بايتات سُلِّمت سلفًا
الإدخال البديل يُحمل قبل معاملة التغيير ويبقى تغيير حالة منفصلًا
الميزانيات
كائن budget الاختياري يقبل أعدادًا صحيحة دقيقة موجبة لا تزيد على 9,007,199,254,740,991
| المفتاح | Default |
|---|---|
| memoryBytes | 268,435,456 |
| outputBytes | 134,217,728 |
| resultBytes | 16,777,216 |
| timeMilliseconds | 60,000 |
| objectCount | 1,000,000 |
| pageCount | 1,024 |
| pixels | 100,000,000 |
ميزانيات الإخراج/النتيجة العامة كل منها تُسقف بنصف ميزانية الذاكرة؛ والتحويل الأرشيفي يطبق السقوف الأصرم أعلاه. هذه تحد موارد العملية المهيأة لا ذاكرة العملية الكلية
فحوص الإلغاء والزمن المنقضي تعاونية عند نقاط فحص العملية والصفحة وقراءة الإدخال وكتابة الإخراج؛ وروتين أصلي طويل يمكنه الاستمرار حتى نقطة فحصه التالية
التقارير تحمل schemaVersion وstatus وstatusCode؛ وأخطاء الميزانية تستخدم حالة 8 والإلغاء 4 وفشل الإدخال/الإخراج 5 وفشل التحليل 6 والوسائط غير الصالحة 1 وفشل التنفيذ 7