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.
Unfortunately, activation email could not send to your email. Please try again.

the document could not be opened

Thread ID:

Created:

Updated:

Platform:

Replies:

125700 Sep 4,2016 12:22 PM Sep 7,2016 09:34 AM Xamarin.Forms 5
loading
Tags: PDF
achraf
Asked On September 4, 2016 12:22 PM

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 ?

Sasi Kumar Sekar [Syncfusion]
Replied On September 5, 2016 02:37 AM

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. 


achraf
Replied On September 5, 2016 08:11 PM

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

Sasi Kumar Sekar [Syncfusion]
Replied On September 6, 2016 07:35 AM

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. 


achraf
Replied On September 6, 2016 09:45 PM

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

Sasi Kumar Sekar [Syncfusion]
Replied On September 7, 2016 09:34 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;