We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Xamarin, DocIO and functionality

Xamarin, DocIO and functionalities

Hello, my company needs to work with doc files in Xamarin-Android.

I have 2 questions :


1. Can i convert doc files to pdf ? I found not but is there something planned in the future ? When ?

2. Can i merge image in doc files ?

Thanks for your answers.

Regards.

PS : English is not my natural born language, sorry for my english.

9 Replies

SV Sarathkumar V Syncfusion Team June 16, 2015 08:47 AM UTC

Hi Benjamin,

Thank you for using Syncfusion products.

Regarding Query #1:

We have confirmed the reported issue, “Word to pdf conversion in Xamarin platform” as a feature and we will implement it in any of our upcoming releases. Please let us know if you require further assistance.

Regarding Query #2:

From your requested query we may suspect that you’re trying to perform the following two operation with images:

Case 1 – Insert/Add images:

If you are trying to add/insert the image in word document use the below code snippet:

Code Snippet:

// Creating a new document.

WordDocument document = new WordDocument();

//Adding a new section to the document.

WSection section = document.AddSection() as WSection;

//Add the paragraph to the section

IWParagraph paragraph = section.AddParagraph();

 

//get the image as stream

Assembly assembly = GetType().Assembly;

Stream imageStream = assembly.GetManifestResourceStream("<<imagefilepath>>");

//append the picture to the paragraph

WPicture picture = paragraph.AppendPicture(imageStream) as WPicture;

//change the picture properties

picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;

picture.VerticalOrigin = VerticalOrigin.Margin;

picture.VerticalPosition = 24;

picture.HorizontalOrigin = HorizontalOrigin.Column;

picture.HorizontalPosition = 263.5f;

picture.WidthScale = 20;

picture.HeightScale = 15;

 

Case 2- Mail Merge with images:

If you are trying to perform the mail merge with images in the word document use the below provided code snippet. In that snippent, template document with merge field is opened using DocIO and merge fields are updated with images using MailMerge Event handler “MergeImageFieldEventHandler”.

Code Snippet:

//create new word document

       WordDocument document = new WordDocument();

       //Open the template document

       document.Open(“<<filename>>”);

       //create the event handler to perform the image merge

       document.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MergeField_Image);

//Handler implementation

       private void MergeField_Image(object sender, MergeImageFieldEventArgs args)

        {

            // Get the image from disk during Merge.

            if (args.FieldName == "<<fieldname>>")//field name wont contains the “Image:”

            {

                //get the image as stream

                Assembly assembly = GetType().Assembly;

                Stream imageStream = assembly.GetManifestResourceStream("<<filepath>>");

                args.ImageStream = imageStream;

            }

        }

Note: template document should contains the merge field whose name should prefix with “Image:” keyword.

For example: «Image:ProductImage»

Please let us know if you have any other questions.

Regards,

Sarath



SV Sarathkumar V Syncfusion Team June 16, 2015 09:37 AM UTC

Hi Benjamin,

Kindly ignore the previous update.

Regarding Query #1:

At present DocIO does not have support for Word to pdf conversion in Xamarin platform. We will implement this feature in any of our upcoming releases. At this moment we cannot provide any concrete timeline for this feature. Please let us know if you require further assistance.

Regarding Query #2:

From your requested query we may suspect that you’re trying to perform the following two operation with images:

Case 1 – Insert/Add images:

If you are trying to add/insert the image in word document use the below code snippet:

Code Snippet:

// Creating a new document.

WordDocument document = new WordDocument();

//Adding a new section to the document.

WSection section = document.AddSection() as WSection;

//Add the paragraph to the section

IWParagraph paragraph = section.AddParagraph();

 

//get the image as stream

Assembly assembly = GetType().Assembly;

Stream imageStream = assembly.GetManifestResourceStream("<<imagefilepath>>");

//append the picture to the paragraph

WPicture picture = paragraph.AppendPicture(imageStream) as WPicture;

//change the picture properties

picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;

picture.VerticalOrigin = VerticalOrigin.Margin;

picture.VerticalPosition = 24;

picture.HorizontalOrigin = HorizontalOrigin.Column;

picture.HorizontalPosition = 263.5f;

picture.WidthScale = 20;

picture.HeightScale = 15;

 

Case 2- Mail Merge with images:

If you are trying to perform the mail merge with images in the word document use the below provided code snippet. In that snippent, template document with merge field is opened using DocIO and merge fields are updated with images using MailMerge Event handler “MergeImageFieldEventHandler”.

Code Snippet:

//create new word document

       WordDocument document = new WordDocument();

       //Open the template document

       document.Open(“<<filename>>”);

       //create the event handler to perform the image merge

       document.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MergeField_Image);

//Handler implementation

       private void MergeField_Image(object sender, MergeImageFieldEventArgs args)

        {

            // Get the image from disk during Merge.

            if (args.FieldName == "<<fieldname>>")//field name wont contains the “Image:”

            {

                //get the image as stream

                Assembly assembly = GetType().Assembly;

                Stream imageStream = assembly.GetManifestResourceStream("<<filepath>>");

                args.ImageStream = imageStream;

            }

        }

Note: template document should contains the merge field whose name should prefix with “Image:” keyword.

For example: «Image:ProductImage»

Please let us know if you have any other questions.

Regards,

Sarath



SS Steve Spormann replied to Sarathkumar V May 13, 2016 09:44 AM UTC

Hi Benjamin,

Kindly ignore the previous update.

Regarding Query #1:

At present DocIO does not have support for Word to pdf conversion in Xamarin platform. We will implement this feature in any of our upcoming releases. At this moment we cannot provide any concrete timeline for this feature. Please let us know if you require further assistance.

Regarding Query #2:

From your requested query we may suspect that you’re trying to perform the following two operation with images:

Case 1 – Insert/Add images:

If you are trying to add/insert the image in word document use the below code snippet:

Code Snippet:

// Creating a new document.

WordDocument document = new WordDocument();

//Adding a new section to the document.

WSection section = document.AddSection() as WSection;

//Add the paragraph to the section

IWParagraph paragraph = section.AddParagraph();

 

//get the image as stream

Assembly assembly = GetType().Assembly;

Stream imageStream = assembly.GetManifestResourceStream("<<imagefilepath>>");

//append the picture to the paragraph

WPicture picture = paragraph.AppendPicture(imageStream) as WPicture;

//change the picture properties

picture.TextWrappingStyle = TextWrappingStyle.InFrontOfText;

picture.VerticalOrigin = VerticalOrigin.Margin;

picture.VerticalPosition = 24;

picture.HorizontalOrigin = HorizontalOrigin.Column;

picture.HorizontalPosition = 263.5f;

picture.WidthScale = 20;

picture.HeightScale = 15;

 

Case 2- Mail Merge with images:

If you are trying to perform the mail merge with images in the word document use the below provided code snippet. In that snippent, template document with merge field is opened using DocIO and merge fields are updated with images using MailMerge Event handler “MergeImageFieldEventHandler”.

Code Snippet:

//create new word document

       WordDocument document = new WordDocument();

       //Open the template document

       document.Open(“<<filename>>”);

       //create the event handler to perform the image merge

       document.MailMerge.MergeImageField += new MergeImageFieldEventHandler(MergeField_Image);

//Handler implementation

       private void MergeField_Image(object sender, MergeImageFieldEventArgs args)

        {

            // Get the image from disk during Merge.

            if (args.FieldName == "<<fieldname>>")//field name wont contains the “Image:”

            {

                //get the image as stream

                Assembly assembly = GetType().Assembly;

                Stream imageStream = assembly.GetManifestResourceStream("<<filepath>>");

                args.ImageStream = imageStream;

            }

        }

Note: template document should contains the merge field whose name should prefix with “Image:” keyword.

For example: «Image:ProductImage»

Please let us know if you have any other questions.

Regards,

Sarath


Sarathkumar V [Syncfusion]
Regarding Query #1:
At present DocIO does not have support for Word to pdf conversion in Xamarin platform. We will implement this feature in any of our upcoming releases. At this moment we cannot provide any concrete timeline for this feature. Please let us know if you require further assistance.
Our company is interested in purchasing your software, but we need the function to convert documents from docIO to pdf, has there been any progress on this front so far?

Best regards.









VR Vijay Ramachandran Syncfusion Team May 16, 2016 09:04 AM UTC

Hi Steve,

Thank you for your update.

At present, we do not have any immediate plan to implement this feature. Also, we are unable to provide exact timeline for adding this support. We will notify you once the feature has been implemented.

Regards,
Vijay R



JN James Neno September 19, 2016 02:59 PM UTC

Sarathkumar,

I am also looking for a product for Word to PDF conversion to use with Xamarin, targeting UWP, iOS, and Android.

Do you have any new information regarding the timeline for Word to PDF support in your mobile libraries?



SV Sivasubramani V Syncfusion Team September 20, 2016 09:41 AM UTC

Hi James,

Thank you for interesting in Syncfusion products. .

We will consider your request to add support for Word to PDF conversion in Xamrin platform. Currently Microsoft have some API limitations in Xamarin and UWP platforms. So at present, we are unable to provide tentative timeline for implementing this feature. We will notify you once this feature has been implemented.

Regards,
Sivasubramani 



PI Pistoolirapu replied to Sivasubramani V October 2, 2016 04:52 PM UTC

Hi James,

Thank you for interesting in Syncfusion products. .

We will consider your request to add support for Word to PDF conversion in Xamrin platform. Currently Microsoft have some API limitations in Xamarin and UWP platforms. So at present, we are unable to provide tentative timeline for implementing this feature. We will notify you once this feature has been implemented.

Regards,
Sivasubramani 


Hello,

Here is one more needing feature of docx to pdf conversion. Now need to create separately docx and pdf if both are needed. Would be very good to create only docx and convert it to pdf, only one thing to update.

Hope the limitations will be sorted soon and this feature comes live. Thanks.


-Juha


AK Ayswarya Krishna Kumar Syncfusion Team October 3, 2016 05:16 AM UTC

Hi Juha,

Thank you for contacting Syncfusion support. We will update you once we implemented the feature.

Regards,
Ayswarya
 



DB Dilli Babu Nandha Gopal Syncfusion Team March 1, 2018 07:39 AM UTC

Hi Juha 
 
Thank you for your patience. 
 
We are glad to announce that Word to PDF conversion in Xamarin platform is supported now. Our Essential Studio 2018 Volume 1 Release v16.1.0.24 is rolled out and is available for download under the following link. 
 
 
For more information, please refer the below KB: 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards, 
Dilli babu. 


Loader.
Live Chat Icon For mobile
Up arrow icon