last day (15 days later) » 

9:00 AM
0
Q: CopyToAsync() dont' fill the memory stream

Razzzzi'm using xamarin.forms app and need to save file(it this situation pdf file). This is my scenario: I'm using media plugin to save images with camera and from that images with PdfDocument object i generate PDF file: PdfDocument document = new PdfDocument(); for (int i = 0; i < Im...

 
You are creating a new stream and it's empty. What are you expecting to happen? Do you mean the memoryStream is empty after CopyToAsync?
 
do you know how CopyToAsync work?
form pdfStream i fill to memoryStream
 
What about CopyTo? Did you try that? Also try removing the using as of now for testing, as using disposes the MemoryStream created. If I get to find anything I'll post here
 
i will try thank you
 
Debug and check if the memoryStream's length is above 0. If above zero the Stream is not empty but the Position has to be reset. Please set Position of the new stream memoryStream to 0, after CopyToAsync() and check if the file write works.
 
9:00 AM
Hmmm i will try, but its very interesting why should not fill this memory stream
the lenght is 0
Maybe the Stream is broken , from geneteration the pdf
I tested on pdf files that is saved in my database and call to save localy in my device it is working
 
9:25 AM
What about pdfStream's Length?
OK good to know
 
9:39 AM
pdfStream got lenght
depented of file size
but maybe the problem is in PDfDocument it is from Syncfusion and i don't have license
 
9:51 AM
OK
 

last day (15 days later) »