|
107 | 107 | ) |
108 | 108 | from .types import ( |
109 | 109 | ALL_PDF_INFO_QUERIES, |
| 110 | + BmpColorModel, |
| 111 | + CompressionLevel, |
| 112 | + ExtractTextGranularity, |
| 113 | + FlattenQuality, |
| 114 | + GifColorModel, |
| 115 | + GraphicSmoothing, |
| 116 | + JpegColorModel, |
110 | 117 | PdfAType, |
111 | 118 | PdfInfoQuery, |
112 | 119 | PdfMergeInput, |
113 | 120 | PdfPageSelection, |
114 | 121 | PdfRedactionInstruction, |
115 | 122 | PdfRGBColor, |
116 | 123 | PdfXType, |
| 124 | + PngColorModel, |
117 | 125 | SummaryFormat, |
118 | 126 | SummaryOutputFormat, |
| 127 | + TiffColorModel, |
119 | 128 | TranslateOutputFormat, |
120 | 129 | ) |
121 | 130 |
|
@@ -2392,7 +2401,7 @@ def extract_pdf_text_to_file( |
2392 | 2401 | file: PdfRestFile | Sequence[PdfRestFile], |
2393 | 2402 | *, |
2394 | 2403 | pages: PdfPageSelection | None = None, |
2395 | | - full_text: Literal["off", "by_page", "document"] = "document", |
| 2404 | + full_text: ExtractTextGranularity = "document", |
2396 | 2405 | preserve_line_breaks: bool = False, |
2397 | 2406 | word_style: bool = False, |
2398 | 2407 | word_coordinates: bool = False, |
@@ -2677,7 +2686,7 @@ def compress_pdf( |
2677 | 2686 | self, |
2678 | 2687 | file: PdfRestFile | Sequence[PdfRestFile], |
2679 | 2688 | *, |
2680 | | - compression_level: Literal["low", "medium", "high", "custom"], |
| 2689 | + compression_level: CompressionLevel, |
2681 | 2690 | profile: PdfRestFile | Sequence[PdfRestFile] | None = None, |
2682 | 2691 | output: str | None = None, |
2683 | 2692 | extra_query: Query | None = None, |
@@ -2711,7 +2720,7 @@ def flatten_transparencies( |
2711 | 2720 | file: PdfRestFile | Sequence[PdfRestFile], |
2712 | 2721 | *, |
2713 | 2722 | output: str | None = None, |
2714 | | - quality: Literal["low", "medium", "high"] = "medium", |
| 2723 | + quality: FlattenQuality = "medium", |
2715 | 2724 | extra_query: Query | None = None, |
2716 | 2725 | extra_headers: AnyMapping | None = None, |
2717 | 2726 | extra_body: Body | None = None, |
@@ -2875,10 +2884,8 @@ def convert_to_png( |
2875 | 2884 | output_prefix: str | None = None, |
2876 | 2885 | page_range: str | Sequence[str] | None = None, |
2877 | 2886 | resolution: int = 300, |
2878 | | - color_model: Literal["rgb", "rgba", "gray"] = "rgb", |
2879 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2880 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2881 | | - | None = None, |
| 2887 | + color_model: PngColorModel = "rgb", |
| 2888 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2882 | 2889 | extra_query: Query | None = None, |
2883 | 2890 | extra_headers: AnyMapping | None = None, |
2884 | 2891 | extra_body: Body | None = None, |
@@ -2915,10 +2922,8 @@ def convert_to_bmp( |
2915 | 2922 | output_prefix: str | None = None, |
2916 | 2923 | page_range: str | Sequence[str] | None = None, |
2917 | 2924 | resolution: int = 300, |
2918 | | - color_model: Literal["rgb", "gray"] = "rgb", |
2919 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2920 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2921 | | - | None = None, |
| 2925 | + color_model: BmpColorModel = "rgb", |
| 2926 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2922 | 2927 | extra_query: Query | None = None, |
2923 | 2928 | extra_headers: AnyMapping | None = None, |
2924 | 2929 | extra_body: Body | None = None, |
@@ -2955,10 +2960,8 @@ def convert_to_gif( |
2955 | 2960 | output_prefix: str | None = None, |
2956 | 2961 | page_range: str | Sequence[str] | None = None, |
2957 | 2962 | resolution: int = 300, |
2958 | | - color_model: Literal["rgb", "gray"] = "rgb", |
2959 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2960 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2961 | | - | None = None, |
| 2963 | + color_model: GifColorModel = "rgb", |
| 2964 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2962 | 2965 | extra_query: Query | None = None, |
2963 | 2966 | extra_headers: AnyMapping | None = None, |
2964 | 2967 | extra_body: Body | None = None, |
@@ -2995,10 +2998,8 @@ def convert_to_jpeg( |
2995 | 2998 | output_prefix: str | None = None, |
2996 | 2999 | page_range: str | Sequence[str] | None = None, |
2997 | 3000 | resolution: int = 300, |
2998 | | - color_model: Literal["rgb", "cmyk", "gray"] = "rgb", |
2999 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3000 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3001 | | - | None = None, |
| 3001 | + color_model: JpegColorModel = "rgb", |
| 3002 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3002 | 3003 | jpeg_quality: int = 75, |
3003 | 3004 | extra_query: Query | None = None, |
3004 | 3005 | extra_headers: AnyMapping | None = None, |
@@ -3037,10 +3038,8 @@ def convert_to_tiff( |
3037 | 3038 | output_prefix: str | None = None, |
3038 | 3039 | page_range: str | Sequence[str] | None = None, |
3039 | 3040 | resolution: int = 300, |
3040 | | - color_model: Literal["rgb", "rgba", "cmyk", "lab", "gray"] = "rgb", |
3041 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3042 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3043 | | - | None = None, |
| 3041 | + color_model: TiffColorModel = "rgb", |
| 3042 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3044 | 3043 | extra_query: Query | None = None, |
3045 | 3044 | extra_headers: AnyMapping | None = None, |
3046 | 3045 | extra_body: Body | None = None, |
@@ -3400,7 +3399,7 @@ async def extract_pdf_text_to_file( |
3400 | 3399 | file: PdfRestFile | Sequence[PdfRestFile], |
3401 | 3400 | *, |
3402 | 3401 | pages: PdfPageSelection | None = None, |
3403 | | - full_text: Literal["off", "by_page", "document"] = "document", |
| 3402 | + full_text: ExtractTextGranularity = "document", |
3404 | 3403 | preserve_line_breaks: bool = False, |
3405 | 3404 | word_style: bool = False, |
3406 | 3405 | word_coordinates: bool = False, |
@@ -3727,7 +3726,7 @@ async def compress_pdf( |
3727 | 3726 | self, |
3728 | 3727 | file: PdfRestFile | Sequence[PdfRestFile], |
3729 | 3728 | *, |
3730 | | - compression_level: Literal["low", "medium", "high", "custom"], |
| 3729 | + compression_level: CompressionLevel, |
3731 | 3730 | profile: PdfRestFile | Sequence[PdfRestFile] | None = None, |
3732 | 3731 | output: str | None = None, |
3733 | 3732 | extra_query: Query | None = None, |
@@ -3761,7 +3760,7 @@ async def flatten_transparencies( |
3761 | 3760 | file: PdfRestFile | Sequence[PdfRestFile], |
3762 | 3761 | *, |
3763 | 3762 | output: str | None = None, |
3764 | | - quality: Literal["low", "medium", "high"] = "medium", |
| 3763 | + quality: FlattenQuality = "medium", |
3765 | 3764 | extra_query: Query | None = None, |
3766 | 3765 | extra_headers: AnyMapping | None = None, |
3767 | 3766 | extra_body: Body | None = None, |
@@ -3925,10 +3924,8 @@ async def convert_to_png( |
3925 | 3924 | output_prefix: str | None = None, |
3926 | 3925 | page_range: str | Sequence[str] | None = None, |
3927 | 3926 | resolution: int = 300, |
3928 | | - color_model: Literal["rgb", "rgba", "gray"] = "rgb", |
3929 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3930 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3931 | | - | None = None, |
| 3927 | + color_model: PngColorModel = "rgb", |
| 3928 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3932 | 3929 | extra_query: Query | None = None, |
3933 | 3930 | extra_headers: AnyMapping | None = None, |
3934 | 3931 | extra_body: Body | None = None, |
@@ -3965,10 +3962,8 @@ async def convert_to_bmp( |
3965 | 3962 | output_prefix: str | None = None, |
3966 | 3963 | page_range: str | Sequence[str] | None = None, |
3967 | 3964 | resolution: int = 300, |
3968 | | - color_model: Literal["rgb", "gray"] = "rgb", |
3969 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3970 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3971 | | - | None = None, |
| 3965 | + color_model: BmpColorModel = "rgb", |
| 3966 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3972 | 3967 | extra_query: Query | None = None, |
3973 | 3968 | extra_headers: AnyMapping | None = None, |
3974 | 3969 | extra_body: Body | None = None, |
@@ -4005,10 +4000,8 @@ async def convert_to_gif( |
4005 | 4000 | output_prefix: str | None = None, |
4006 | 4001 | page_range: str | Sequence[str] | None = None, |
4007 | 4002 | resolution: int = 300, |
4008 | | - color_model: Literal["rgb", "gray"] = "rgb", |
4009 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4010 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4011 | | - | None = None, |
| 4003 | + color_model: GifColorModel = "rgb", |
| 4004 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4012 | 4005 | extra_query: Query | None = None, |
4013 | 4006 | extra_headers: AnyMapping | None = None, |
4014 | 4007 | extra_body: Body | None = None, |
@@ -4045,10 +4038,8 @@ async def convert_to_jpeg( |
4045 | 4038 | output_prefix: str | None = None, |
4046 | 4039 | page_range: str | Sequence[str] | None = None, |
4047 | 4040 | resolution: int = 300, |
4048 | | - color_model: Literal["rgb", "cmyk", "gray"] = "rgb", |
4049 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4050 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4051 | | - | None = None, |
| 4041 | + color_model: JpegColorModel = "rgb", |
| 4042 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4052 | 4043 | jpeg_quality: int = 75, |
4053 | 4044 | extra_query: Query | None = None, |
4054 | 4045 | extra_headers: AnyMapping | None = None, |
@@ -4087,10 +4078,8 @@ async def convert_to_tiff( |
4087 | 4078 | output_prefix: str | None = None, |
4088 | 4079 | page_range: str | Sequence[str] | None = None, |
4089 | 4080 | resolution: int = 300, |
4090 | | - color_model: Literal["rgb", "rgba", "cmyk", "lab", "gray"] = "rgb", |
4091 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4092 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4093 | | - | None = None, |
| 4081 | + color_model: TiffColorModel = "rgb", |
| 4082 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4094 | 4083 | extra_query: Query | None = None, |
4095 | 4084 | extra_headers: AnyMapping | None = None, |
4096 | 4085 | extra_body: Body | None = None, |
|
0 commit comments