Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
Archivo: Open.cs Proyecto: 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();
 }
Ejemplo n.º 3
0
Archivo: Save.cs Proyecto: 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);
 }
     );
Ejemplo n.º 4
0
Archivo: Save.cs Proyecto: 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);
        }
Ejemplo n.º 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);
Ejemplo n.º 6
0
Archivo: Save.cs Proyecto: 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)
     );
Ejemplo n.º 7
0
Archivo: Save.cs Proyecto: 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));