DocIO need some help/example

Dear Support,
attached is an example application which i am trying to use DocIO without any success.

 I am trying to generate pdf (and doc) (with all details filled) from a MyTemplate1.docx which is located under the folder MyTemplates.
Can you please provide some help ?
thanks 



Attachment: PrintFromTemplate_50e481bd.zip

8 Replies 1 reply marked as answer


DA DAN April 6, 2021 05:34 AM UTC

Dear Hemalatha,
the sample app you provided is very helpful , thank you for that!
is it possible, as soon as the pdf is generated to be opened in a Blazor PDF Viewer Component (maybe in a full screen dialog).
can you show how we can do that on the sample you provided?
thank you



LB Lokesh Baskar Syncfusion Team April 7, 2021 12:21 PM UTC

Hi Danil,  
  
To achieve your requirement, we have shared the simple Blazor PDF Viewer sample with full screen dialog. Please refer to the below sample and documentation for your reference.  
  
  
  
Please let us know if you have any other questions. 

Regards,  
Lokesh B  



DA DAN April 7, 2021 06:58 PM UTC

Dear Lokesh,
instead of  viewer.Load(DocumentPath, null);
how can we load the PDF which was generated  in memory stream directly to the viewer ?

 //Converts Word document into PDF document
        PdfDocument pdfDocument = render.ConvertToPDF(document);
    //Releases all resources used by the Word document and DocIO Renderer objects
    render.Dispose();
        document.Dispose();
        //Saves the PDF file
        MemoryStream outputStream = new MemoryStream();
    pdfDocument.Save(outputStream);
        //Closes the instance of PDF document object
        pdfDocument.Close();
        outputStream.Position = 0;
        return outputStream;


LB Lokesh Baskar Syncfusion Team April 9, 2021 12:38 AM UTC

Hi Danil, 

Thank you for update. 

We are currently checking the feasible solution for your requirement. We will update you more details on 9th April, 2021.

Regards, 
Lokesh B 




DA DAN April 9, 2021 06:59 PM UTC

Ok thank you 


HC Hemalatha Chiranjeevulu Syncfusion Team April 9, 2021 11:47 PM UTC

Hi DANIL,

Sorry for the inconvenience.

Currently, we are checking with PDF library to achieve your requirement and will update you with more details on 12th April 2021.

Please let us know if you have any other questions.

Regards,
Hemalatha C 



LB Lokesh Baskar Syncfusion Team April 12, 2021 10:39 AM UTC

Hi Danil,

Thank you for your patients.

We have prepared the sample application to achieve your requirement. We suggest you load stream in the PDF Viewer by converting stream into base64String. Please refer to the below code snippet and sample,  

Code Snippet:  
  
byte[] byteArray = stream.ToArray();  
string base64String = Convert.ToBase64String(byteArray);  
DocumentPath = "data:application/pdf;base64," + base64String;  
viewer.Load(DocumentPath, null);  
  

Please let us know if you have any other questions. 
Regards,
Lokesh B 


Loader.
Up arrow icon