Hi,
We have a PDFDraw.ExportAsync function.
You can use it in the same way as the Export function, with the exception that it doesn't take a file path.
Instead, you can create a RandomAccessStreamFilter. Here's an example of how to use it.
if (doc != null)
{
StorageFile outfile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync("Temp.png", CreationCollisionOption.GenerateUniqueName);
IRandomAccessStream stream = await outfile.OpenAsync(FileAccessMode.ReadWrite);
IFilter filter = new RandomAccessStreamFilter(stream);
PDFDraw draw = new PDFDraw();
Page page = doc.GetPage(1);
ObjSet hintSet = new ObjSet();
Obj encoderParam = hintSet.CreateDict();
encoderParam.PutNumber("Quality", 80);
await draw.ExportAsync(page, filter, "png", encoderParam);
System.Diagnostics.Debug.WriteLine("Exported page 1 to: " + outfile.Path);
}
There appears to be a bug in 6.3.2 if you use ExportAsync with only 3 parameters, or make the 4th parameter null. We will fix this for future versions.
Instead, you can just leave the encoderParam object alone and not add any numbers before you use it.
Another option, if you prefer to use a file path, is to just stick the Export function inside a task you create yourself:
await Task.Run(() =>
{
draw.Export(page, System.IO.Path.Combine(ApplicationData.Current.TemporaryFolder.Path, "Exported.png"));
});
If this does not help, please let us know what you are trying to do.
Best Regards,
Tomas Hofmann