Save PDF iOS

Hi
I am Pretty new to syncfusion.
I want to create a PDF in a Xamarin.Forms app and used the Documentation (Docu)
But the dependency of ISave on iOS does not work.
It does not seem to know the QLPreviewItemBundle and the PreviewControllerDS classes.
I use the Syncfusion.Xamarin.Pdf V16.2.0.42 on VS2017E.
Are These classes not used anymore?



-----------------------------------------------------------------------------CODE-------------------------------------------------------------------------------- 

public async Task Save(string filename, string contentType, MemoryStream stream)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            string filePath = Path.Combine(path, filename);
            try
            {
                FileStream fileStream = File.Open(filePath, FileMode.Create);
                stream.Position = 0;
                stream.CopyTo(fileStream);
                fileStream.Flush();
                fileStream.Close();
            }
            catch (Exception e)
            {
            }
            UIViewController currentController = UIApplication.SharedApplication.KeyWindow.RootViewController;
            while (currentController.PresentedViewController != null)
            {
                currentController = currentController.PresentedViewController;
            }
            UIView currentView = currentController.View;
            QLPreviewController preview = new QLPreviewController();
            QLPreviewItem item = new QLPreviewItemBundle(filename, filePath);
            preview.DataSource = new PreviewControllerDS(item);
            //UIViewController uiView = currentView as UIViewController;
            currentController.PresentViewController(preview, true, null);
        }

2 Replies

MA Marco July 26, 2018 01:43 PM UTC

Found it!

I downloaded this sample (sample ) on this Forum post (forum post)


KC Karthikeyan Chandrasekar Syncfusion Team July 27, 2018 09:32 AM UTC

Hi Marco, 
Thank you for contacting Syncfusion support. 
In the sample you can find those missing classes(PreviewControllerDS, QLPreviewItemFileSystem) as mentioned in the below screenshot. I have also attached those files in the attachment below. 
 

Please let me know if you need any further assistance in this. 
Regards, 
Karthikeyan  


Loader.
Up arrow icon