|
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, |
@@ -2876,10 +2885,8 @@ def convert_to_png( |
2876 | 2885 | output_prefix: str | None = None, |
2877 | 2886 | page_range: str | Sequence[str] | None = None, |
2878 | 2887 | resolution: int = 300, |
2879 | | - color_model: Literal["rgb", "rgba", "gray"] = "rgb", |
2880 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2881 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2882 | | - | None = None, |
| 2888 | + color_model: PngColorModel = "rgb", |
| 2889 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2883 | 2890 | extra_query: Query | None = None, |
2884 | 2891 | extra_headers: AnyMapping | None = None, |
2885 | 2892 | extra_body: Body | None = None, |
@@ -2916,10 +2923,8 @@ def convert_to_bmp( |
2916 | 2923 | output_prefix: str | None = None, |
2917 | 2924 | page_range: str | Sequence[str] | None = None, |
2918 | 2925 | resolution: int = 300, |
2919 | | - color_model: Literal["rgb", "gray"] = "rgb", |
2920 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2921 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2922 | | - | None = None, |
| 2926 | + color_model: BmpColorModel = "rgb", |
| 2927 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2923 | 2928 | extra_query: Query | None = None, |
2924 | 2929 | extra_headers: AnyMapping | None = None, |
2925 | 2930 | extra_body: Body | None = None, |
@@ -2956,10 +2961,8 @@ def convert_to_gif( |
2956 | 2961 | output_prefix: str | None = None, |
2957 | 2962 | page_range: str | Sequence[str] | None = None, |
2958 | 2963 | resolution: int = 300, |
2959 | | - color_model: Literal["rgb", "gray"] = "rgb", |
2960 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
2961 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
2962 | | - | None = None, |
| 2964 | + color_model: GifColorModel = "rgb", |
| 2965 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
2963 | 2966 | extra_query: Query | None = None, |
2964 | 2967 | extra_headers: AnyMapping | None = None, |
2965 | 2968 | extra_body: Body | None = None, |
@@ -2996,10 +2999,8 @@ def convert_to_jpeg( |
2996 | 2999 | output_prefix: str | None = None, |
2997 | 3000 | page_range: str | Sequence[str] | None = None, |
2998 | 3001 | resolution: int = 300, |
2999 | | - color_model: Literal["rgb", "cmyk", "gray"] = "rgb", |
3000 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3001 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3002 | | - | None = None, |
| 3002 | + color_model: JpegColorModel = "rgb", |
| 3003 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3003 | 3004 | jpeg_quality: int = 75, |
3004 | 3005 | extra_query: Query | None = None, |
3005 | 3006 | extra_headers: AnyMapping | None = None, |
@@ -3038,10 +3039,8 @@ def convert_to_tiff( |
3038 | 3039 | output_prefix: str | None = None, |
3039 | 3040 | page_range: str | Sequence[str] | None = None, |
3040 | 3041 | resolution: int = 300, |
3041 | | - color_model: Literal["rgb", "rgba", "cmyk", "lab", "gray"] = "rgb", |
3042 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3043 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3044 | | - | None = None, |
| 3042 | + color_model: TiffColorModel = "rgb", |
| 3043 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3045 | 3044 | extra_query: Query | None = None, |
3046 | 3045 | extra_headers: AnyMapping | None = None, |
3047 | 3046 | extra_body: Body | None = None, |
@@ -3401,7 +3400,7 @@ async def extract_pdf_text_to_file( |
3401 | 3400 | file: PdfRestFile | Sequence[PdfRestFile], |
3402 | 3401 | *, |
3403 | 3402 | pages: PdfPageSelection | None = None, |
3404 | | - full_text: Literal["off", "by_page", "document"] = "document", |
| 3403 | + full_text: ExtractTextGranularity = "document", |
3405 | 3404 | preserve_line_breaks: bool = False, |
3406 | 3405 | word_style: bool = False, |
3407 | 3406 | word_coordinates: bool = False, |
@@ -3728,7 +3727,7 @@ async def compress_pdf( |
3728 | 3727 | self, |
3729 | 3728 | file: PdfRestFile | Sequence[PdfRestFile], |
3730 | 3729 | *, |
3731 | | - compression_level: Literal["low", "medium", "high", "custom"], |
| 3730 | + compression_level: CompressionLevel, |
3732 | 3731 | profile: PdfRestFile | Sequence[PdfRestFile] | None = None, |
3733 | 3732 | output: str | None = None, |
3734 | 3733 | extra_query: Query | None = None, |
@@ -3762,7 +3761,7 @@ async def flatten_transparencies( |
3762 | 3761 | file: PdfRestFile | Sequence[PdfRestFile], |
3763 | 3762 | *, |
3764 | 3763 | output: str | None = None, |
3765 | | - quality: Literal["low", "medium", "high"] = "medium", |
| 3764 | + quality: FlattenQuality = "medium", |
3766 | 3765 | extra_query: Query | None = None, |
3767 | 3766 | extra_headers: AnyMapping | None = None, |
3768 | 3767 | extra_body: Body | None = None, |
@@ -3928,10 +3927,8 @@ async def convert_to_png( |
3928 | 3927 | output_prefix: str | None = None, |
3929 | 3928 | page_range: str | Sequence[str] | None = None, |
3930 | 3929 | resolution: int = 300, |
3931 | | - color_model: Literal["rgb", "rgba", "gray"] = "rgb", |
3932 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3933 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3934 | | - | None = None, |
| 3930 | + color_model: PngColorModel = "rgb", |
| 3931 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3935 | 3932 | extra_query: Query | None = None, |
3936 | 3933 | extra_headers: AnyMapping | None = None, |
3937 | 3934 | extra_body: Body | None = None, |
@@ -3968,10 +3965,8 @@ async def convert_to_bmp( |
3968 | 3965 | output_prefix: str | None = None, |
3969 | 3966 | page_range: str | Sequence[str] | None = None, |
3970 | 3967 | resolution: int = 300, |
3971 | | - color_model: Literal["rgb", "gray"] = "rgb", |
3972 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
3973 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
3974 | | - | None = None, |
| 3968 | + color_model: BmpColorModel = "rgb", |
| 3969 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
3975 | 3970 | extra_query: Query | None = None, |
3976 | 3971 | extra_headers: AnyMapping | None = None, |
3977 | 3972 | extra_body: Body | None = None, |
@@ -4008,10 +4003,8 @@ async def convert_to_gif( |
4008 | 4003 | output_prefix: str | None = None, |
4009 | 4004 | page_range: str | Sequence[str] | None = None, |
4010 | 4005 | resolution: int = 300, |
4011 | | - color_model: Literal["rgb", "gray"] = "rgb", |
4012 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4013 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4014 | | - | None = None, |
| 4006 | + color_model: GifColorModel = "rgb", |
| 4007 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4015 | 4008 | extra_query: Query | None = None, |
4016 | 4009 | extra_headers: AnyMapping | None = None, |
4017 | 4010 | extra_body: Body | None = None, |
@@ -4048,10 +4041,8 @@ async def convert_to_jpeg( |
4048 | 4041 | output_prefix: str | None = None, |
4049 | 4042 | page_range: str | Sequence[str] | None = None, |
4050 | 4043 | resolution: int = 300, |
4051 | | - color_model: Literal["rgb", "cmyk", "gray"] = "rgb", |
4052 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4053 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4054 | | - | None = None, |
| 4044 | + color_model: JpegColorModel = "rgb", |
| 4045 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4055 | 4046 | jpeg_quality: int = 75, |
4056 | 4047 | extra_query: Query | None = None, |
4057 | 4048 | extra_headers: AnyMapping | None = None, |
@@ -4090,10 +4081,8 @@ async def convert_to_tiff( |
4090 | 4081 | output_prefix: str | None = None, |
4091 | 4082 | page_range: str | Sequence[str] | None = None, |
4092 | 4083 | resolution: int = 300, |
4093 | | - color_model: Literal["rgb", "rgba", "cmyk", "lab", "gray"] = "rgb", |
4094 | | - smoothing: Literal["none", "all", "text", "line", "image"] |
4095 | | - | Sequence[Literal["none", "all", "text", "line", "image"]] |
4096 | | - | None = None, |
| 4084 | + color_model: TiffColorModel = "rgb", |
| 4085 | + smoothing: GraphicSmoothing | Sequence[GraphicSmoothing] | None = None, |
4097 | 4086 | extra_query: Query | None = None, |
4098 | 4087 | extra_headers: AnyMapping | None = None, |
4099 | 4088 | extra_body: Body | None = None, |
|
0 commit comments