Ejemplo n.º 1
0
        public void SaveAs(string filePath, DocumentFormatType type = DocumentFormatType.Rtf)
        {
            ThrowIfDisposed();

            var currentFormat         = (object)Discovery(type);
            var currentOutputFilePath = (object)filePath;

            _document.SaveAs2(FileName: ref currentOutputFilePath,
                              FileFormat: ref currentFormat,
                              LockComments: ref Unknown,
                              Password: ref Unknown,
                              AddToRecentFiles: ref Unknown,
                              WritePassword: ref Unknown,
                              ReadOnlyRecommended: ref Unknown,
                              EmbedTrueTypeFonts: ref Unknown,
                              SaveNativePictureFormat: ref Unknown,
                              SaveFormsData: ref Unknown,
                              SaveAsAOCELetter: ref Unknown,
                              Encoding: ref Unknown,
                              InsertLineBreaks: ref Unknown,
                              AllowSubstitutions: ref Unknown,
                              LineEnding: ref Unknown,
                              AddBiDiMarks: ref Unknown,
                              CompatibilityMode: ref Unknown);
        }
Ejemplo n.º 2
0
        private static MicrosoftDocumentSaveFormat Discovery(DocumentFormatType type)
        {
            switch (type)
            {
            case DocumentFormatType.Rtf:
                return(MicrosoftDocumentSaveFormat.wdFormatRTF);

            default:
                return(MicrosoftDocumentSaveFormat.wdFormatDocument);
            }
        }
Ejemplo n.º 3
0
        public void SaveAs(string filePath, DocumentFormatType type = DocumentFormatType.Rtf)
        {
            ThrowIfDisposed();

            switch (type)
            {
            case DocumentFormatType.Word:
                _document.Save();
                break;

            case DocumentFormatType.Rtf:
                _document.SaveAs2(filePath, WdSaveFormat.wdFormatRTF);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 4
0
        public static CommonContentType GetContentType(DocumentFormatType formatType)
        {
            switch (formatType)
            {
            case DocumentFormatType.BIN:
                return(CommonContentType.Bin);

            case DocumentFormatType.FLAT:
                return(CommonContentType.Flat);

            case DocumentFormatType.ODF:
                return(CommonContentType.ODF);

            case DocumentFormatType.XML:
                return(CommonContentType.XML);

            case DocumentFormatType.ZIP:
                return(CommonContentType.ZIP);

            default:
                return(CommonContentType.OTHER);
            }
        }
Ejemplo n.º 5
0
 internal static StatusResponseType SubmitHelper(string NodeURL, string secToken, string dataFlow, string flowOperation, byte[] doc, string docName, DocumentFormatType docFormat, string docID)
 {
     try
     {
         AttachmentType att1 = new AttachmentType();
         att1.Value = doc;
         NodeDocumentType doc1 = new NodeDocumentType();
         doc1.documentName = docName;
         doc1.documentFormat = docFormat;
         doc1.documentId = docID;
         doc1.documentContent = att1;
         NodeDocumentType[] docArray = new NodeDocumentType[1];
         docArray[0] = doc1;
         Submit sub1 = new Submit();
         sub1.securityToken = secToken;
         sub1.transactionId = "";
         sub1.dataflow = dataFlow;
         sub1.flowOperation = flowOperation;
         sub1.documents = docArray;
         NetworkNode2 nn = new NetworkNode2();
         nn.SoapVersion = SoapProtocolVersion.Soap12;
         nn.Url = NodeURL;
         return nn.Submit(sub1);
     }
     catch (SoapException sExept)
     {
         db_Ref.InsertT_OE_SYS_LOG("WQX", sExept.Message.SubStringPlus(0, 1999));
         return null;
     }
 }
Ejemplo n.º 6
0
 public GenericXmlType() {
     this.formatField = DocumentFormatType.XML;
 }
Ejemplo n.º 7
0
 public GenericXmlType()
 {
     this.formatField = DocumentFormatType.XML;
 }
Ejemplo n.º 8
0
 public void SaveAs(string filePath, DocumentFormatType type = DocumentFormatType.Rtf)
 {
 }
 public void SaveAs(string filePath, DocumentFormatType type = DocumentFormatType.Rtf)
 {
     try { _document.SaveToFile(filePath, type == DocumentFormatType.Rtf ? FileFormat.Rtf : FileFormat.Doc); }
     catch { _log.Error("CANNOT SAVE FILE: {0}", filePath); }
 }