We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

File does not begin with '%PDF-'

When I convert Xls document to pdf using aspose.cell 7.01.6 .It is coverting the pdf fine but when i open up it is saying "file does not begin with '%PDF-'
"

This is very urgent can you guys tell me what i need to do.

Thanks

Srikar

Hi,

Please test your issue with the latest:
Aspose.Cells for .NET (Latest Version) and see if it resolves the problem.

If the problem persists, then please provide me your xls file so that I could test it at my end and report the problem to development team.

It did not help me.Still gives me the same error.

When i open the pdf in browser I am getting the Issue.

I am attaching the screen shot

Here is the code...

Dim license As Aspose.Cells.License = New Aspose.Cells.License()

license.SetLicense("License.lic")

'Get the Word document

Dim workbook As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(strFilePath)

Dim strPDFFileName As String

If (strFileName.EndsWith("x")) Then

strPDFFileName = strMainFolder + "FilesProcessed\ASPOSE\Convert to PDF\" + Left(strFileName, strFileName.Length - 5) + ".pdf"

Else

strPDFFileName = strMainFolder + "FilesProcessed\ASPOSE\Convert to PDF\" + Left(strFileName, strFileName.Length - 4) + ".pdf"

End If

workbook.Save(strPDFFileName, New PdfSaveOptions(Aspose.Cells.SaveFormat.Pdf))

workbook = Nothing

Hi,

It’s opening fine. Please see the sample code below and the output pdf.

Will you please let me know your .NET framework version number and also are you using ClientProfile version of .NET Framework?

C#


string path = @“F:\Shak-Data-RW\Downloads\Srikar+Test.xls”;

Workbook workbook = new Workbook(path);

workbook.Save(path + “.out.pdf”);

I am using .net2.0 and i am using vb.net not c#

Also i dont have a response object in my code as this is a windows service.

Srikar

Hi,

VB.NET and C# does not make any difference. However, if you are using ClientProfile version, then make sure you are using correct dll.

There are two dlls.

One is for normal version of .NET framework found in net2.0 folder
One is for clientprofile version of .NET framework found in net3.5_ClientProfile folder.

See this image for more help.