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 _PREVIEWGEN_H_INCLUDED_
21 #define _PREVIEWGEN_H_INCLUDED_
26 #include "paper_size.h"
29 #define PDF_PAGE_MAX_VAL 999999
30 #define PDF_PAGE_MAX_STR_LEN (sizeof("999999") - 1)
33 struct pdf_preview_settings {
36 int page; /* page from 1 */
45 /* TODO: check for additional types */
46 #define IMG_FILE_EXTS {"png", "ppm", "jpg", "jpeg", "tif", "tiff", "gif", \
48 #define PDF_FILE_EXT "pdf"
50 #define PREVIEW_TEMP_DIR "/tmp/mobileprint"
51 #define IMG_TEMP_FILE_NAME PREVIEW_TEMP_DIR "/out.ppm"
52 #define PREVIEW_IMG_TEMP_FILE_NAME IMG_TEMP_FILE_NAME
55 int is_page_landscape(struct size_pts *s);
56 int get_pdf_page_size(const char *path, struct size_pts *s);
57 int get_pdf_pages_count(const char *path);
58 int get_pdf_preview(const char *path,
59 const struct pdf_preview_settings *settings,
60 void **out_img, int *size);
61 enum file_type get_file_type(const char *fname);
63 #endif /* _PREVIEWGEN_H_INCLUDED_ */