コード例 #1
0
 /* ----------------------------------------------------------------- */
 ///
 /// Overwrite
 ///
 /// <summary>
 /// Overwrites the PDF document.
 /// </summary>
 ///
 /// <param name="src">Facade object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Overwrite(this MainFacade src)
 {
     if (src.Bindable.History.Undoable)
     {
         src.Save(src.Bindable.Source.Value.FullName);
     }
 }
コード例 #2
0
ファイル: Open.cs プロジェクト: yas/Cube.Pdf
 /* ----------------------------------------------------------------- */
 ///
 /// Close
 ///
 /// <summary>
 /// Closes the current PDF document.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 /// <param name="save">Save before closing.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Close(this MainFacade src, bool save)
 {
     if (save)
     {
         src.Save(src.Value.Source.FullName, false);
     }
     src.Close();
 }
コード例 #3
0
ファイル: Save.cs プロジェクト: yas/Cube.Pdf
 /* ----------------------------------------------------------------- */
 ///
 /// Save
 ///
 /// <summary>
 /// Saves the PDF document to the specified file path.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 /// <param name="dest">Path to save.</param>
 /// <param name="reopen">
 /// Value indicating whether to reopen the document.
 /// </param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Save(this MainFacade src, string dest, bool reopen) => src.Save(
     dest,
     e => { src.Backup.Invoke(e); src.Cache?.Clear(); },
     e => {
     if (reopen)
     {
         src.Reload(e.FullName);
     }
     src.Value.Set(Properties.Resources.MessageSaved, e.FullName);
 }
     );
コード例 #4
0
ファイル: Save.cs プロジェクト: yas/Cube.Pdf
        /* ----------------------------------------------------------------- */
        ///
        /// Save
        ///
        /// <summary>
        /// Save the PDF document
        /// </summary>
        ///
        /// <param name="src">Source object.</param>
        /// <param name="dest">Saving file information.</param>
        /// <param name="prev">Action to be invoked before saving.</param>
        /// <param name="next">Action to be invoked after saving.</param>
        ///
        /* ----------------------------------------------------------------- */
        public static void Save(this MainFacade src, string dest, Action <Entity> prev, Action <Entity> next)
        {
            var obj   = src.Value;
            var itext = obj.Source.GetItext(obj.Query, obj.IO, false);

            obj.Set(itext.Metadata, itext.Encryption);

            src.Save(itext, new SaveOption(obj.IO)
            {
                Target      = SaveTarget.All,
                Split       = false,
                Destination = dest,
                Metadata    = obj.Metadata,
                Encryption  = obj.Encryption,
                Attachments = itext.Attachments,
            }, prev, next);
        }
コード例 #5
0
 /* ----------------------------------------------------------------- */
 ///
 /// Save
 ///
 /// <summary>
 /// Saves the PDF document to the specified file path.
 /// </summary>
 ///
 /// <param name="src">Facade object.</param>
 /// <param name="dest">File path.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Save(this MainFacade src, string dest) => src.Save(dest, true);
コード例 #6
0
ファイル: Save.cs プロジェクト: yas/Cube.Pdf
 /* ----------------------------------------------------------------- */
 ///
 /// Extract
 ///
 /// <summary>
 /// Extracts PDF pages saves to a file with the specified options.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 /// <param name="options">Save options.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Extract(this MainFacade src, SaveOption options) => src.Save(
     null,
     options,
     e => src.Backup.Invoke(e),
     e => src.Value.Set(Properties.Resources.MessageSaved, e.FullName)
     );
コード例 #7
0
ファイル: Save.cs プロジェクト: yas/Cube.Pdf
 /* ----------------------------------------------------------------- */
 ///
 /// Overwrite
 ///
 /// <summary>
 /// Overwrites the PDF document.
 /// </summary>
 ///
 /// <param name="src">Source object.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Overwrite(this MainFacade src) =>
 src.Value.History.Undoable.Then(() => src.Save(src.Value.Source.FullName));