1. Changed license year
[apps/home/mobileprint.git] / mobileprint / previewgen / include / pdfgen.h
1 /*
2 *  Mobileprint
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
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
9
10 * http://floralicense.org/license/
11
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.
17 *
18 */
19
20 #ifndef _PDFGEN_H_INCLUDED_
21 #define _PDFGEN_H_INCLUDED_
22
23
24 #define TEMP_PDFTOPDF_FNAME     "/tmp/mobileprint/pdftopdf_tmp.pdf"
25
26 #define SCALE_WALLET_W  3.30709
27 #define SCALE_WALLET_H
28
29 enum page_orientation {
30         //PAGE_ORIENTATION_AUTO,
31         PAGE_ORIENTATION_PORTRAIT=3,
32         PAGE_ORIENTATION_LANDSCAPE
33 };
34
35 enum page_scale_type {
36         SCALE_FIT_TO_PAPER,
37         SCALE_CUSTOM,
38         SCALE_RELATIVE,
39         SCALE_ORIGINAL
40 };
41
42 struct page_scale {
43         enum page_scale_type type;
44         int zoom;
45         double w;
46         double h;
47 };
48
49 struct pdfgen_settings {
50         int n_up;
51         char *paper_name;
52         char *ppd_filename;
53         struct page_scale scale;
54         enum page_orientation orientation;
55 };
56
57
58 int call_pdftopdf(const char *path, const char *outfile,
59                                   const struct pdfgen_settings *settings);
60 int call_imagetopdf(const char *path, const char *outfile,
61                                         const struct pdfgen_settings *settings);
62 int call_pdfunite(char **const infiles_z, const char *outfile);
63
64
65 #endif /* _PDFGEN_H_INCLUDED_ */
66