Problem of startxref not found

Hey i load a file from my loading service into a stream, then the the file stream is not loaded into the pdf.document, waiting for like 2-3 minutes and then giving error that startxref not found…
and the sometimes there is another error of response is already commited…
i seriously need help with this.

Hi Hafsa,


Thanks for contacting support.

Looks like the API is not able to determine / process the source file loaded in Stream instance. Can you please confirm that correct source file is being loaded. In case you still face the same issue, can you please share some code snippet which can help us in replicating the problem in our environment. We are sorry for your inconvenience.

I am facing the same issue while creating document object by passing memorystream. here is the code I am trying:

doc = new Aspose.Pdf.Document(inputStream);

I am getting inputstream from webservice.

Exception : startxref not found.

@contact2shukla,

How the input stream comes and what is the format of input document? Please share a problematic document. We will investigate your scenario in our environment and share our findings with you. Your response is awaited.

Hi Imran,

Thanks for the quick response.

Input stream is coming from webservice(OpenText API) and format of the input document is .tiff.

I am able to convert same input stream to pdf using below code:

                Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
                Bitmap b = new Bitmap(mStreamTiff); //mStreamTiff is memorystream (Stream of tiff file)
                // Create a new Page in the Pdf document
                Aspose.Pdf.Page currpage = doc.Pages.Add();

                // Set margins so image will fit, etc.
                currpage.PageInfo.Margin.Top = 5;
                currpage.PageInfo.Margin.Bottom = 5;
                currpage.PageInfo.Margin.Left = 5;
                currpage.PageInfo.Margin.Right = 5;

                currpage.PageInfo.Width = (b.Width / b.HorizontalResolution) * 72;
                currpage.PageInfo.Height = (b.Height / b.VerticalResolution) * 72;

                // Create an image object
                Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();                   
                // Add the image into paragraphs collection of the page
                currpage.Paragraphs.Add(image1);
                //Set the ImageStream to a MemoryStream object
                image1.ImageStream = mStreamTiff;                   
                // Save the Pdf
                doc.Save(outputFilePath + "PerformaceImprovement_out.pdf");

But I am loosing annotations present in tiff stream while converting tiff stream(Contains tiff annotation) to pdf.
My requirement is to convert tiff stream to pdf along with annotations present in stream .

When I am using below code:
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(inputStream); // Same Stream as used in the above code.

Getting Exception : startxref not found.

Just wanted to know if we can convert tiff stream (MemoryStream) to pdf along with annotations present in tiff stream.

Just fyi, the same has been asked by some other person. Here is the link:

Please let me know if you need any more information.

@contact2shukla,

Kindly send us a sample TIFF file (including Annotations) for the testing purposes. Aspose.PDF API has support of exporting Annotations, and we need to investigate your scenario in our environment to find the root cause of this error. Your response is awaited.

I need to check with company if I can share the document as document contains some company informations. In the mean while is it possible for you to share the code in dot Net to convert tiff(having annotations) file to pdf if it is different what I shared earlier?

@contact2shukla,

We receive documents for testing purposes only and do not share publicly. You can send confidential documents through a private message. The above code example to convert TIFF into PDF format is fine. We require your source problematic TIFF file and highlight the problematic region with a snapshot.

Hi,

I have created tiff file with annotation (TestingTiffWithAnnotation.tif). Converted this file to pdf by using Aspose.pdf and some other API. Attaching all 3 files.

Added annotations in tiff file are:

  1. light green highlighter on text (This is testing document)
  2. Added light green rectangle.

You can see all annotation in pdf converted by some other API. Else you can try to open tiff file with some tiff editor tools.

It is not allowing me to add .tif file. I have sent separate email to you.

Please let me know if you have any question

@contact2shukla,

Kindly let us know the email address which you have used to send files. You can ZIP tif files, and then upload into the post. There is an upload button in the header of the post editor. However, if the size of ZIP file is more than 3MB, then please upload to any free file sharer server, and share its download URL. Your response is awaited.

Hi Imran,

I got the approval to share the file with Aspose. Is it a way to start communication over the email instead web post?

We want to test it before making decision for the license.

@contact2shukla,

You can share files through the private message. Your response is awaited.

Please find the attached file below:

Tiff File.zip (61.0 KB)

@contact2shukla,

You cannot import TIFF image into Aspose.PDF for .NET API, since this error occurred because of the missing starting element.

Furthermore, we cannot view annotations in the TIFF image as we can view in the PNG image. We insert a TIFF image in the PDF document, since the annotations are not visible.

Annotation is present in the tiff file but you can not see in the windows image viewer. You need a tiff viewer to see the annotation present in tiff file.

Requirements is, once you convert tiff to pdf, annotation should be visible in the pdf file.

If you need a example, I can convert same tiff to pdf(with visible annotation) with some other vendor api and share with you. The same is not happening with Aspose api. Aspose is not exporting existing annotation while doing conversion.

I attached the png to just inform you the location of the annotation in the tiff file.

Please let me know if you have any question.

@contact2shukla,

We have tried with TIFF viewer, but unable to locate the annotations. This is the snapshot: https://i.imgur.com/7MwDJcj.png

Kindly send us the download link of TIFF viewer setup.

Try to open shared tiff file here:

http://www.rasteredge.com/demo/online-document-viewer/

you should be able to see the annotation on the file.

@contact2shukla,

We have logged an investigation under the ticket ID PDFNET-44456 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Hi Imran,

Do we have any ETA for this issue?

We want to validate this feature before buying the licenses.

–Thanks,
Ashish Shukla

@contact2shukla,

The linked ticket ID PDFNET-44456 has just been identified and logged into our bug tracking system. It is difficult to share an estimate before the completion of the analysis phase. We will let you know once a significant progress has been made in this regard.