Ejemplo n.º 1
0
        private static void faxDocumentPreviewSample_stampMergeData(ApiService apiClient)
        {
            //create a stampMergeField.
            apiFaxDocumentStampMergeFieldKey key = new apiFaxDocumentStampMergeFieldKey();

            key.xCoord          = 0;
            key.yCoord          = 0;
            key.xCoordSpecified = true;
            key.yCoordSpecified = true;

            apiFaxDocumentStampMergeFieldImageValue imageValue = new apiFaxDocumentStampMergeFieldImageValue();

            imageValue.FileName        = "stamp.png";
            imageValue.FileData        = sample_StampData();
            imageValue.height          = 189;
            imageValue.heightSpecified = true;
            imageValue.width           = 388;
            imageValue.widthSpecified  = true;

            apiFaxDocumentStampMergeField imageStamp = new apiFaxDocumentStampMergeField();

            imageStamp.ImageValue = imageValue;
            imageStamp.Key        = key;

            //add the imageStamp into an array of stampMergeFields.
            apiFaxDocumentStampMergeField[] stampMergeFields = new apiFaxDocumentStampMergeField[1] {
                imageStamp
            };

            //create a new instance of faxDocumentPreview request.
            faxDocumentPreviewRequest previewRequest = new faxDocumentPreviewRequest();

            previewRequest.StampMergeData = stampMergeFields;
            previewRequest.DocumentRef    = "xxx-xxx";

            //call the faxDocumentPreview method.
            faxDocumentPreviewResponse previewResponse = apiClient.FaxDocumentPreview(previewRequest);

            // extracting responses
            Console.WriteLine("response: " + "number of pages: \n" + previewResponse.NumberOfPages);
            Console.WriteLine("preview in base64 format: \n \n" + previewResponse.TiffPreview);

            Console.ReadLine();
        }
Ejemplo n.º 2
0
        private static void faxDocumentPreviewSample_docMergeData(ApiService apiClient)
        {
            //create docMergeFields
            apiFaxDocumentDocMergeField docMergeField1 = new apiFaxDocumentDocMergeField();

            docMergeField1.Key   = "field1";
            docMergeField1.Value = "lazy dog";

            apiFaxDocumentDocMergeField docMergeField2 = new apiFaxDocumentDocMergeField();

            docMergeField2.Key   = "field2";
            docMergeField2.Value = "fat pig";

            apiFaxDocumentDocMergeField docMergeField3 = new apiFaxDocumentDocMergeField();

            docMergeField3.Key   = "field3";
            docMergeField3.Value = "fat pig";

            // create an array of docMergeFields.
            apiFaxDocumentDocMergeField[] docMergeData = new apiFaxDocumentDocMergeField[3] {
                docMergeField1, docMergeField2, docMergeField3
            };

            //create a new instance of faxDocumentPreview request.
            faxDocumentPreviewRequest previewRequest = new faxDocumentPreviewRequest();

            previewRequest.DocMergeData = docMergeData;
            previewRequest.DocumentRef  = "some-doc-ref";

            //call the faxDocumentPreview method.
            faxDocumentPreviewResponse previewResponse = apiClient.FaxDocumentPreview(previewRequest);

            // extracting responses
            Console.WriteLine("response: " + "number of pages: \n" + previewResponse.NumberOfPages);
            Console.WriteLine("preview in base64 format: \n \n" + previewResponse.TiffPreview);

            Console.ReadLine();
        }