We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

the document could not be opened

Hello ,

I'm trying to generate a pdf document and every time I try so i got : the documetn could not be opened , also I can't find the document on my phone . 

any help or simple sample ?

5 Replies

SK Sasi Kumar Sekar Syncfusion Team September 5, 2016 06:37 AM UTC

Hi Achraf, 
 
Thank you for contacting Syncfusion support, 
We have created simple sample as per your concern, please find the sample below link.  
 
Kindly let me know if you have any further assistance on this. 
 
Regards, 
Sasi Kumar S. 



AC achraf September 6, 2016 12:11 AM UTC

Thank you so much !!

I tried your solution it works fine on my emulateur on my laptop , but when i try it on my phone (4.2 JB) it does not work , picture in zip file will explain

I think it's a problem with creating the folder wich will contains the files , I tried manually to create the folder , but same problem 

Attachment: Syncfusionachraf_a41212b2.rar


SK Sasi Kumar Sekar Syncfusion Team September 6, 2016 11:35 AM UTC

Hi Achraf,  
 
Thank you for contacting Syncfusion support, 
We have analyzed your query,the problem may be occur due to runtime access permission. Please check whether the “PDF” file is created in “Device Storage/Syncfusion/” or “Documents” folder. 
If the file is not created within the mentioned folder then we have suggest you to enable the write access permission by adding below statement in Androidmanifes.XML file. 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
Please try this and let me know your feedback, 
 
Kindly let me know if you have any further assistance on this. 
 
Regards, 
Sasi Kumar S. 



AC achraf September 7, 2016 01:45 AM UTC

Thank you for the solution it works fine .

I have 2 more question plz ,

1- I'm working on project , I have  a string and a decimal in sqlite , i bind them in a listview in a content page , how can I print them  in pdf file Like invoice app you build

this is my  part of code : 

<StackLayout>
      <ListView ItemsSource="{Binding bankexpand}" x:Name="panda" >
        
        <ListView.ItemTemplate>

          <DataTemplate>

            <ViewCell>
              <StackLayout Orientation="Horizontal">
                <Grid HorizontalOptions="FillAndExpand"  >


                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>


                  </Grid.ColumnDefinitions>
                  <Label   Text="{Binding Type}" FontSize="18" Grid.Column="0"  HorizontalTextAlignment="Center" VerticalTextAlignment="Center"></Label>
                  <!--Text="{Binding Type}"-->
                  
                  <Label Text="{Binding Amount}"  FontSize="18"  Grid.Column="1" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"></Label>
                  <!--Text="{Binding Amount}"-->

                </Grid>

              </StackLayout>

the bankexpand file is a sqlite file : 

public String Type { get; set; }

        public decimal Amount { get; set; }

        public override string ToString()
        {
            return string.Format("Type : {0}, Amount : {1}", Type, Amount);
        }


2- I have a problem in  : Stream imgStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("SyncfusionLogo.jpg");
            PdfImage img = PdfImage.FromStream(imgStream);     //always in this line there is error Null , I will add a screen shot in rar file.

            page.Graphics.DrawImage(img, new RectangleF(g.ClientSize.Width - 200, result.Bounds.Y, 190, 45));


thank you so much for help  .

Attachment: imgprobleme_99a4d871.rar


SK Sasi Kumar Sekar Syncfusion Team September 7, 2016 01:34 PM UTC

Hi Achraf, 

Please find the response for your query, 
Question 
Answer 
1.how can I print them  in pdf file Like invoice app you build 
We have created simple sample for filling the form field from the Xaml page and please find the sample below for your reference. 
 
2. always in this line there is error Null , I will add a screen 
We have analyzed your code snippet. Please provide exact patch for the file. 
Example:   
Stream docStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("PdfTableCreation.Assets.Form1.pdf"); 
We have provide the exact path in the given sample, please provide the same. 

Please let me know if you have any further assistance on this. 

Regards, 
Sasi Kumar S.

Loader.
Live Chat Icon For mobile
Up arrow icon