4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _PAGE_PREVIEW_H_INCLUDED_
21 #define _PAGE_PREVIEW_H_INCLUDED_
25 #include <previewgen.h>
26 #include <preview_coords.h>
31 #define IMAGE_CONVERT_TEMP_FILE PREVIEW_TEMP_DIR "/convert_tmp.ppm"
34 Evas *get_pdf_preview_page_image(const char *fname, int first_page,
35 const struct preview_page_px *settings_px);
37 int save_pdf_preview_page_image(const char *pdf_fname, int first_page,
38 const struct preview_page_req *settings_pts,
39 const char *out_pic_fname);
40 int save_empty_preview_page_image(const struct preview_page_req *settings_pts,
41 const char *out_pic_fname);
44 int get_pdf_preview_pages(const char *fname,
45 const struct paper_size_pts *paper_size,
46 const struct size_px *available_size_px,
47 enum page_orientation orientation,
48 int n_up, int is_original_size, int is_grayscale);
50 int get_img_preview_pages(char **const fnames, int files_count,
51 const struct paper_size_pts *paper_size,
52 const struct size_px *available_size_px,
53 enum page_orientation orientation,
54 int n_up, int is_original_size, int is_grayscale);
57 int save_pdf_preview_page_image_w_np(void *img_buf, int img_size,
58 int page_num, int pages_count,
59 //const struct preview_page_req *settings_pts,
60 const struct preview_settings_px *settings_px,
61 const char *out_pic_fname);
62 int save_pdf_preview_page_image_w_np_fname(const char *pdf_fname,
63 int page_num, int pages_count,
64 const struct preview_settings_px *settings_px,
65 const char *out_pic_fname);
67 int pdf2pdf_preview_pages(const char *fname, const char *out_pdf_fname,
68 const char *printer_ppd_fname,
69 const struct paper_size_pts *paper_size,
70 enum page_orientation orientation, int n_up,
71 const struct page_scale *scale, int is_grayscale);
73 int img2pdf_preview_pages(const char *fname, const char *out_pdf_fname,
74 const char *printer_ppd_fname,
75 const struct paper_size_pts *paper_size,
76 const struct size_px *available_size_px,
77 enum page_orientation orientation, int n_up,
78 const struct page_scale *scale, int is_grayscale);
79 int img_files2pdf_preview_pages(char **const fnames,
81 const char *out_pdf_fname,
82 const char *printer_ppd_fname,
83 const struct paper_size_pts *paper_size,
84 const struct size_px *available_size_px,
85 enum page_orientation orientation, int n_up,
86 const struct page_scale *scale, int is_grayscale);
88 int process_image_downscale(const char *fname, const char *out_fname,
89 const struct size_px *available_size_px);
91 int load_pdf_page_img(const char *fname, int page,
92 const struct preview_page_px *settings_px,
93 void **out_img, int *size);
95 #endif /* _PAGE_PREVIEW_H_INCLUDED_ */