Cells 4.7.0 saving to PDF stream does not work

Last post 03-03-2009, 6:19 AM by Amjad Sahi. 12 replies.
Sort Posts: Previous Next
  •  02-27-2009, 8:54 AM 167357

    Cells 4.7.0 saving to PDF stream does not work .NET

    Attachment: Present (inaccessible)

    Hi, i'm trying to save an workbook to pdf  via a stream(filestream) directly:

    workbook.Save( stream, FileFormatType.Pdf);

    Then i try to save this stream to a file and the resulted file is not readable by AcrobatReader.


    Thank you very much for your feedback.


    Best regards,
    Claudiu Farcas
     
  •  02-27-2009, 10:56 AM 167389 in reply to 167357

    Re: Cells 4.7.0 saving to PDF stream does not work

    Hi Claudiu,

     

    Thank you for providing the sample application.

     

    We will look into the direct XLS2PDF conversion using File Streams. Currently, as a work around, either you can save the XLS file to PDF directly without using the File Stream (wb.Save("c:\\MyPDF.PDF", FileFormatType.Pdf)) or you can use Aspose.Cells and Aspose.PDF combination to generate a PDF from XLS using File Stream. Please see the following sample code in this regard,

     

    Sample Code:

     

    Workbook wb = new Workbook();

    wb.Worksheets.Clear();

    Worksheet ws1 = wb.Worksheets.Add("shee1");

    ws1.Cells[0, 0].PutValue("SampleHeader1");

    ws1.Cells[0, 2].PutValue("SampleHeader2");

    wb.Save("c:\\MySpreadsheet2.xml", FileFormatType.AsposePdf);

     

    using (FileStream fs = File.Create(@"C:\sample2.pdf"))

    {

        Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf(fs);

        pdf1.BindXML("c:\\MySpreadsheet2.xml", null);

        pdf1.Close();

        fs.Close();

    }

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-02-2009, 2:10 AM 167554 in reply to 167357

    Re: Cells 4.7.0 saving to PDF stream does not work

    Attachment: Present (inaccessible)

    Hi,

     

    Thank you for considering Aspose.

     

    Please try the attached latest fix. We have supported to directly export workbook to PDF stream.

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-02-2009, 5:28 AM 167600 in reply to 167554

    Re: Cells 4.7.0 saving to PDF stream does not work

    Still doesn't work in my case. The converted pdf file seems to be corrupt. (Thats what Acrobat says)

    I tried both xls and xlsx. Nothing special in these files. Just some testtext and a single image.

    Edit:
    Same problem when converting from file to file, like the example

    //Instantiate the Workbook object

    Workbook workbook = new Workbook();

     

    //Open an excel file

    workbook.Open("f:\\test\\Input.xls");

     

    //Save the document in Pdf format

    workbook.Save("f:\\test\\Output.pdf"FileFormatType.Pdf);

     
  •  03-02-2009, 6:21 AM 167614 in reply to 167600

    Re: Cells 4.7.0 saving to PDF stream does not work

    Hi,

     

    Thank you for considering Aspose.

     

    We have found the issue when we convert the XLS2PDF using file stream but it works fine in the direct file conversion. Please share your template file and we will look into it.

     

    Thank You & Best Regards,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-02-2009, 6:26 AM 167616 in reply to 167614

    Re: Cells 4.7.0 saving to PDF stream does not work .NET

    Attachment: Present (inaccessible)
    As allready said, a very simple excel workbook.
     
  •  03-02-2009, 6:28 AM 167617 in reply to 167600

    Re: Cells 4.7.0 saving to PDF stream does not work

    pyranha:
    Still doesn't work in my case. The converted pdf file seems to be corrupt. (Thats what Acrobat says)

    I tried both xls and xlsx. Nothing special in these files. Just some testtext and a single image.
     
    Thanks for your feedback, we will look into it soon.
    pyranha:
    Edit:
    Same problem when converting from file to file, like the example

    //Instantiate the Workbook object

    Workbook workbook = new Workbook();

     

    //Open an excel file

    workbook.Open("f:\\test\\Input.xls");

     

    //Save the document in Pdf format

    workbook.Save("f:\\test\\Output.pdf"FileFormatType.Pdf);

    Well, I don't find any problem using the above code (directly converting excel file to pdf....file2file conversion), the ouput pdf file is ok. Could you post your input file here, we will check it soon.

    Thank you.

     


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-02-2009, 6:34 AM 167619 in reply to 167617

    Re: Cells 4.7.0 saving to PDF stream does not work

    Attachment: Present (inaccessible)
    Hi,

    Thanks for sharing your testexcel.xlsx file here.

    I tried the conversion using the following code and it works fine. The ouput file (attached) opened fine into Acrobat Reader.

    Sample code:

                    //Instantiate the Workbook object
                      Workbook workbook = new Workbook();

                      //Open an excel file
                      workbook.Open("f:\\test\\testexcel.xlsx");

                      //Save the document in Pdf format
                      workbook.Save("f:\\test\\testOutputexcel.pdf", FileFormatType.Pdf);

     

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-02-2009, 6:35 AM 167620 in reply to 167617

    Re: Cells 4.7.0 saving to PDF stream does not work

    ok direkt file to file conversion works... was another problem, my mistake. I'm sorry for the unnecessary effort.
     
  •  03-03-2009, 2:17 AM 167812 in reply to 167554

    Re: Cells 4.7.0 saving to PDF stream does not work

    Attachment: Present (inaccessible)
    Hi, I just tried the fix 4.7.0.1.
    Unfortunatelly with sample i have attached on the first message post of this thread post , it does not work.
    I have updated the references to this new Aspose.Cells assembly so basically it should work if your fix have resolved this issue.
    I have Adobe Reader 8.1.3. and the message when i try to open the pdf file is:
    "There was an error opening this document. The file is damaged and could not be repaired."
    In the attachment is the result pdf file.

    Thank you for your feedback.

    Best regards,
    Claudiu Farcas
     
  •  03-03-2009, 3:39 AM 167832 in reply to 167812

    Re: Cells 4.7.0 saving to PDF stream does not work

    Hi Claudiu,

    Thank you for considering Aspose.

    We are working on resolving your mentioned issue and we will get back to you soon.

    Thank you for understanding,


    Nausherwan Aslam
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-03-2009, 3:47 AM 167836 in reply to 167812

    Re: Cells 4.7.0 saving to PDF stream does not work

    Hi,

    Thanks for providing us the template file.

    Hopefully, we can provide you the fix in 1-2 days for your need.

    Thanks and keep in touch.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
  •  03-03-2009, 6:19 AM 167864 in reply to 167836

    Re: Cells 4.7.0 saving to PDF stream does not work

    Attachment: Present (inaccessible)

    Hi,

    Please try the attached version (4.7.0.2), we have fixed the issue.

    Thank you.


    Amjad Sahi
    Support Developer,
    Aspose Sialkot Team
    Contact Us
     
View as RSS news feed in XML