Ejemplo n.º 1
0
        /// <summary>
        /// Returns an array of arguments to be sent to the Ghostscript API
        /// </summary>
        /// <param name="inputPath">Path to the source file</param>
        /// <param name="outputPath">Path to the output file</param>
        /// <param name="firstPage">The page of the file to start on</param>
        /// <param name="lastPage">The page of the file to end on</param>
        private static string[] GetArgs(string inputPath,
                                        string outputPath,
                                        int firstPage,
                                        int lastPage,
                                        int width,
                                        int height)
        {
            // To maintain backwards compatibility, this method uses previous hardcoded values.

            GhostscriptSettings s = new GhostscriptSettings();

            s.Device     = GhostscriptDevices.jpeg;
            s.Page.Start = firstPage;
            s.Page.End   = lastPage;
            s.Resolution = new Int32Size(width, height);

            GhostscriptPageSize pageSize = new GhostscriptPageSize();

            pageSize.Native = GhostscriptPageSizes.a7;
            s.Size          = pageSize;

            return(GetArgs(inputPath, outputPath, s));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns an array of arguments to be sent to the Ghostscript API
        /// </summary>
        /// <param name="inputPath">Path to the source file</param>
        /// <param name="outputPath">Path to the output file</param>
        /// <param name="firstPage">The page of the file to start on</param>
        /// <param name="lastPage">The page of the file to end on</param>
        private static string[] GetArgs(string inputPath,
			string outputPath,
			int firstPage,
			int lastPage,
			int width,
			int height)
        {
            // To maintain backwards compatibility, this method uses previous hardcoded values.

            GhostscriptSettings s = new GhostscriptSettings();
            s.Device = GhostscriptDevices.jpeg;
            s.Page.Start = firstPage;
            s.Page.End = lastPage;
            s.Resolution = new Int32Size(width, height);

            GhostscriptPageSize pageSize = new GhostscriptPageSize();
            pageSize.Native = GhostscriptPageSizes.a7;
            s.Size = pageSize;

            return GetArgs(inputPath, outputPath, s);
        }