Conflict between Syncfusion.DocIO.Portable and Syncfusion.DocIO.UWP

Hello, I am trying to convert a document to PDF using Syncfusion.DocIO.Portable. However, it conflicts with Syncfusion.DocIO.UWP (SfRichTextBoxAdv). Do you have any ideas how to solve this? We can't remove  Syncfusion.DocIO.UWP (SfRichTextBoxAdv) since we've been using this in our project. Thanks~

Please see the error below : 

The type 'WordDocument' exists in both 'Syncfusion.DocIO.Portable, Version=19.2200.0.47, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89' and 'Syncfusion.DocIO.UWP, Version=19.2460.0.47, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'


14 Replies 1 reply marked as answer

KG Kalaivannan Ganesan Syncfusion Team July 16, 2021 03:08 PM UTC

Hi Dennis Arriola,

Thanks for contacting Syncfusion support.

We can reproduce the reported issue with “Conflict occurs between Syncfusion.DocIO.Portable and Syncfusion.DocIO.UWP” when doing PDF conversion along with the SfRichTextBoxAdv control. we will validate and update you with further details on 20th July 2021.

Please let us know if you have any other questions.

Regards,
Kalaivannan


Marked as answer

KG Kalaivannan Ganesan Syncfusion Team July 20, 2021 12:16 PM UTC

Hi Dennis Arriola,

Thanks for the patience.

Word to PDF conversion is not supported in Universal applications. DocIOsupports Word to PDF conversion in UWP using DocIORenderer NET Core library, which contains Syncfusion.DocIO.Portable as one of the dependent assemblies. To know more about Doc to PDF conversion in UWP, please refer to the below link
https://www.syncfusion.com/kb/10270/how-to-convert-word-document-to-pdf-in-uwp  

SfRichTextBoxAdv control in UWP, uses Syncfusion.DocIO.UWP as one of the dependent assemblies for the importing and exporting operation. Thus, conflict occurs between two assemblies.

Assemblies which will get a conflict when we perform Word to PDF conversion along with SfRichTextBxAdv control in UWP.

 
UWP 
Portable 
Syncfusion.DocIO.UWP.dll  
Syncfusion.DocIO.Portable.dll  
 

To avoid this assembly conflict in your project, we request you to use the extern alias feature in .NET and UWP which allows you to give referenced assemblies an alias via that little Aliases property inthe property window for any referenced libraries.

And also created a sample to demonstrate the same, which can be downloaded from the below location
https://www.syncfusion.com/downloads/support/forum/167259/ze/UWP_PDFConversion1577359917

Note: Since we need to make changes in the assembly’s property manually, we request it is mandatory to use assemblies instead of using NuGet.

Please find the assemblies required to meet your requirement for SfRichTextBoxAdv and the Word to PDF conversion from below:
 
SfRichTextBoxAdv UWP 
WordDocument to PDF conversion UWP 
1. Syncfusion.DocIO.UWP 
2. Syncfusion.OfficeChart.UWP 
3. Syncfusion.SfRadialMenu.UWP 
4. Syncfusion.SfRichTextBoxAdv.UWP 
5. Syncfusion.SfShared.UWP 
1. Syncfusion.DocIO.Portable
2. Syncfusion.Compression.Portable
3. Syncfusion.OfficeChart.Portable
4. Syncfusion.Pdf.Portable
5. Syncfusion.DocIORenderer.Portable
6. SkiaSharp
7. Syncfusion.SkiaSharpHelper.Portable
 
 

Please let us know if you have any other questions.

Regards,
Kalaivannan
 
 


DA Dennis Arriola July 23, 2021 03:13 AM UTC

Hello Kalaivannan,

Thank you for your response.

I have a question, since we cannot use nugget, how can we get the assemblies we needed? 
Should we install the Syncfusion Essential Studio for us to get these assemblies?

Thank you.



KG Kalaivannan Ganesan Syncfusion Team July 23, 2021 01:54 PM UTC

Hi Dennis Arriola,

Thanks for the update.

Yes, We need to install the Syncfusion Essential Studio UWP and need to refer the assemblies from the build installed location for the necessary Syncfusion controls.

Please use the below link to know about the download and installation of the Syncfusion Essential Studio UWP
https://help.syncfusion.com/uwp/installation-and-upgrade/download

Please use the below link to know about the installed location of Assemblies and Samples.
https://help.syncfusion.com/uwp/deployment#installed-location

Please use the below link to know about the necessary assemblies for the SfRichTextBoxAdv control.
https://help.syncfusion.com/uwp/control-dependencies#sfrichtextboxadv

DocIO Supports Word to PDF conversion in UWP application using DocIORenderer. Since DocIO Renderer is a .NET core library. Please refer to the required assemblies in the
ASP.NET section from the below location
https://help.syncfusion.com/file-formats/docio/assemblies-required#converting-word-document-to-pdf

Please let us know if you have any other questions.

Regards,
Kalaivannan
 



DA Dennis Arriola August 19, 2021 06:33 AM UTC

Hello  Kalaivannan Ganesa,

It's me again, Dennis.
I have a question regarding the conversion of files (specifically on excel) to PDF.
We have observed that big filesize files take some time in conversion.
For example, a 1.57MB excel file with many worksheets and complex format takes so much time and the result is not successful. It throws an 

Stacktrace:

at Syncfusion.XlsIO.Calculate.CalcEngine.SaveStrings(String& text)
at Syncfusion.XlsIO.Calculate.CalcEngine.Parse(String text)
at Syncfusion.XlsIO.Calculate.CalcEngine.ParseAndComputeFormula(String formula)
at Syncfusion.XlsIO.Implementation.CFApplier.CheckAndApplyConditionFormula(IConditionalFormat format, IRange cell, ExtendedFormatImpl xf, String formatFirstFormula)
at Syncfusion.XlsIO.Implementation.CFApplier.CheckAndApplyConditionFormula(IConditionalFormat format, IRange cell, ExtendedFormatImpl xf)
at Syncfusion.XlsIO.Implementation.CFApplier.CheckAndApplyCondition(IConditionalFormat format, IRange cell, ExtendedFormatImpl xf)
at Syncfusion.XlsIO.Implementation.CFApplier.MergeCF(ConditionalFormats format, ExtendedFormatImpl xf, IRange cell)
at Syncfusion.XlsIO.Implementation.WorksheetImpl.ApplyCF(IRange cfRange)
at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawSheet(IWorksheet wkSheet, IRange[] printAreas)
at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawWorkSheet(IWorksheet worksheet, Int32 sheetsCount, LayoutOptions layoutOptions)
at Syncfusion.XlsIORenderer.ExcelToPdfConverter.ConvertDocument()
at Syncfusion.XlsIORenderer.ExcelToPdfConverter.Convert()
at Syncfusion.XlsIORenderer.ExcelToPdfConverter.Convert(XlsIORendererSettings converterSettings)
at Syncfusion.XlsIORenderer.XlsIORenderer.ConvertToPDF(IWorkbook workbook, XlsIORendererSettings converterSettings)

Now, my question is, is it possible to cancel the conversion after a certain period of time thru CancellationTokenSource?
I checked the dll, the 
ConvertToPDF  method do not accept  CancellationTokenSource.

Thank you!
Hoping for your response. :)



DA Dennis Arriola replied to Dennis Arriola August 19, 2021 07:56 AM UTC

Basically what I want to achieve is to cancel the conversion after e.g. 5 seconds.



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 19, 2021 11:03 AM UTC

Hi Dennis, 

Syncfusion XlsIO do not have support to stop the Excel to PDF conversion after a certain period of time. Once the conversion is started, either an exception is thrown or may take time to convert.  

You have provided the stack trace of exception. As the stack trace shows that the exception is thrown at CalcEngine, we suggest you to use the code snippet provided in below link, to reduce the performance, and let us know if the issue is resolved. 

If the issue still persists, kindly confirm the exception and Syncfusion XlsIO version you are using at your end and share the Excel document, which will be helpful for u sin investigating the query and provide prompt solution at the earliest. 

Regards, 
Keerthi. 



DA Dennis Arriola August 24, 2021 02:05 AM UTC

Hello Konduru Keerthi Konduru Ravichandra Raju,

My apologies for the late reply. 

RE: 
https://help.syncfusion.com/file-formats/xlsio/faqs/how-to-overcome-stackoverflow-exception-with-iworksheet-calculate?cs-save-lang=1&cs-lang=uwp  
May I ask how to properly incorporate this setting. I cannot successfully use the code snippet from the example. 
Below is a screenshot of the method :


Syncfusion XlsIO version is 19.2200.0.44

Thank you~




KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 24, 2021 07:53 AM UTC

Hi Dennis, 

From the screenshot, we find that you are using the code snippet properly. Kindly share us the error or exception or difficulty you are facing, which will be helpful for us in checking the query. 

Regards, 
Keerthi.


DA Dennis Arriola August 25, 2021 05:29 AM UTC

Hello  Konduru Keerthi Konduru Ravichandra Raju,

Thank you for your response. 

I have observed that if the excel file has no calculation, just a plain excel file, it throws 

Exception thrown: 'System.NullReferenceException' in  worksheet.EnableSheetCalculations();


For the other excel file with computation, it throws :

Exception thrown: 'System.ArgumentException' in Syncfusion.XlsIO.Portable.dll
Exception occured: Syncfusion.XlsIO.Portable mismatched string quotes

same stacktrace as above.

Is there a way where I can cancel the conversion in ConvertToPDF  method for a certain period of time as I have mentioned above.

Thanks a lot.



DA Dennis Arriola replied to Dennis Arriola August 25, 2021 05:42 AM UTC

Sometimes it also throws Exception thrown: 'System.OutOfMemoryException' in Syncfusion.Pdf.Portable.dll 

   at Syncfusion.Pdf.Graphics.Fonts.UnicodeTrueTypeFont..ctor(Stream font, Single size, CompositeFontType type, String name)
   at Syncfusion.Pdf.Graphics.PdfTrueTypeFont.CreateFontInternal(Stream fontStream, PdfFontStyle style)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.GetPdfTrueTypeFont(Font font, Boolean isEmbedFont, Stream alternateFontStream)
   at Syncfusion.XlsIORenderer.PDFRenderer.GetAscent(Font font)
   at Syncfusion.XlsIO.RendererBase.FindAscent(String text, Font font)
   at Syncfusion.XlsIO.RendererBase.DrawRTFText(RectangleF cellRect, RectangleF adjacentRect, Boolean isShape, Boolean isWrapText, Boolean isHorizontalTextOverflow, Boolean isVerticalTextOverflow, Boolean isChartShape)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawRTFText(RectangleF cellRect, RectangleF adjacentRect, PdfGraphics graphics, List`1 richTextFont, List`1 drawString, Boolean isShape, Boolean isWrapText, Boolean isHorizontalTextOverflow, Boolean isVerticalTextOverflow)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawCell(ExtendedFormatImpl extendedFormatImpl, IRange cell, RectangleF cellRect, RectangleF adjacentRect, PdfGraphics graphics, Single mergedWidth, String cellText, Boolean isHasStyle)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawCell(MigrantRangeImpl cell, RectangleF cellRect, RectangleF adjacentRect, PdfGraphics graphics, Single mergedWidth)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawCells(WorksheetImpl sheet, Int32 firstRow, Int32 firstColumn, Int32 lastRow, Int32 lastColumn, PdfGraphics graphics, Single originalWidth, Single startX, Single startY, Single rangeWidth)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawRow(IWorksheet wkSheet, Int32 startColIndex, Int32 endColIndex, Int32 startRowIndex, Int32 endRowIndex, Single xValue, Single yValue, Single originalWidth, Single startX, Single startY, Single rangeWidth, Single rangeHeight)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawRow(IWorksheet wkSheet, Int32 startColumn, Int32 endColumn, Int32 startRow, Int32 endRow, Single xValue, Single yValue, Single originalWidth, Boolean isBlank)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawSheet(IWorksheet wkSheet, IRange[] printAreas)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.DrawWorkSheet(IWorksheet worksheet, Int32 sheetsCount, LayoutOptions layoutOptions)
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.ConvertDocument()
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.Convert()
   at Syncfusion.XlsIORenderer.ExcelToPdfConverter.Convert(XlsIORendererSettings converterSettings)
   at Syncfusion.XlsIORenderer.XlsIORenderer.ConvertToPDF(IWorkbook workbook, XlsIORendererSettings converterSettings)



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team August 25, 2021 01:04 PM UTC

Hi Dennis, 

As mentioned in our previous update, Syncfusion XlsIO do not have support to stop the Excel to PDF conversion after a certain period of time.  

You have mentioned different issues or exceptions. We kindly request you to share the respective input Excel documents you are using at your end, which will be helpful for us in reproducing and investigating the issues. Also please confirm the Syncfusion XlsIO version you are using at your end. 

Regards, 
Keerthi. 



DA Dennis Arriola September 1, 2021 12:51 AM UTC

Hello Keerthi,


Apologies for the late reply.


RE: Exception thrown: 'System.NullReferenceException' in worksheet.EnableSheetCalculations();

I can't seem be able to upload the file.

Please see :




For the other files, I'm afraid I cannot share it because it contains confidential information.




Regards,


Dennis



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team September 1, 2021 07:34 AM UTC

Hi Dennis, 

You can mail the files to [email protected] mentioning the forum id. We use the files only for checking the reported query and testing purpose and maintains them confidentially. Those files will not be shared to others. 

Regards, 
Keerthi. 


Loader.
Up arrow icon