|
88 | 88 | PdfFlattenAnnotationsPayload, |
89 | 89 | PdfFlattenFormsPayload, |
90 | 90 | PdfFlattenTransparenciesPayload, |
| 91 | + PdfImportFormDataPayload, |
91 | 92 | PdfInfoPayload, |
92 | 93 | PdfLinearizePayload, |
93 | 94 | PdfMergePayload, |
@@ -2706,6 +2707,33 @@ def convert_to_word( |
2706 | 2707 | timeout=timeout, |
2707 | 2708 | ) |
2708 | 2709 |
|
| 2710 | + def import_form_data( |
| 2711 | + self, |
| 2712 | + file: PdfRestFile | Sequence[PdfRestFile], |
| 2713 | + data_file: PdfRestFile | Sequence[PdfRestFile], |
| 2714 | + *, |
| 2715 | + output: str | None = None, |
| 2716 | + extra_query: Query | None = None, |
| 2717 | + extra_headers: AnyMapping | None = None, |
| 2718 | + extra_body: Body | None = None, |
| 2719 | + timeout: TimeoutTypes | None = None, |
| 2720 | + ) -> PdfRestFileBasedResponse: |
| 2721 | + """Import form data from a data file into an existing PDF with form fields.""" |
| 2722 | + |
| 2723 | + payload: dict[str, Any] = {"files": file, "data_file": data_file} |
| 2724 | + if output is not None: |
| 2725 | + payload["output"] = output |
| 2726 | + |
| 2727 | + return self._post_file_operation( |
| 2728 | + endpoint="/pdf-with-imported-form-data", |
| 2729 | + payload=payload, |
| 2730 | + payload_model=PdfImportFormDataPayload, |
| 2731 | + extra_query=extra_query, |
| 2732 | + extra_headers=extra_headers, |
| 2733 | + extra_body=extra_body, |
| 2734 | + timeout=timeout, |
| 2735 | + ) |
| 2736 | + |
2709 | 2737 | def flatten_pdf_forms( |
2710 | 2738 | self, |
2711 | 2739 | file: PdfRestFile | Sequence[PdfRestFile], |
@@ -3993,6 +4021,33 @@ async def convert_to_word( |
3993 | 4021 | timeout=timeout, |
3994 | 4022 | ) |
3995 | 4023 |
|
| 4024 | + async def import_form_data( |
| 4025 | + self, |
| 4026 | + file: PdfRestFile | Sequence[PdfRestFile], |
| 4027 | + data_file: PdfRestFile | Sequence[PdfRestFile], |
| 4028 | + *, |
| 4029 | + output: str | None = None, |
| 4030 | + extra_query: Query | None = None, |
| 4031 | + extra_headers: AnyMapping | None = None, |
| 4032 | + extra_body: Body | None = None, |
| 4033 | + timeout: TimeoutTypes | None = None, |
| 4034 | + ) -> PdfRestFileBasedResponse: |
| 4035 | + """Asynchronously import form data from a data file into a PDF.""" |
| 4036 | + |
| 4037 | + payload: dict[str, Any] = {"files": file, "data_file": data_file} |
| 4038 | + if output is not None: |
| 4039 | + payload["output"] = output |
| 4040 | + |
| 4041 | + return await self._post_file_operation( |
| 4042 | + endpoint="/pdf-with-imported-form-data", |
| 4043 | + payload=payload, |
| 4044 | + payload_model=PdfImportFormDataPayload, |
| 4045 | + extra_query=extra_query, |
| 4046 | + extra_headers=extra_headers, |
| 4047 | + extra_body=extra_body, |
| 4048 | + timeout=timeout, |
| 4049 | + ) |
| 4050 | + |
3996 | 4051 | async def flatten_pdf_forms( |
3997 | 4052 | self, |
3998 | 4053 | file: PdfRestFile | Sequence[PdfRestFile], |
|
0 commit comments