File: FlateDecode; Reason: Invalid compression method

Hi Aspose,

I am using Aspose.Pdf for .Net to generate a batch of one page letters. The batch is a single pdf file which goes to the printer where it should be printed, put into envelopes and dispatched.

There is a code field on each letter to show if it should be grouped with other letters into a single envelope. (e.g. “Page 1 of 5”). The pdf looks fine and prints ok on our office printers.

The printer wants to process the pdf file and add codes for the envelope machine. When the printer tries to access the pdf programmatically they get the following error:

%%[ Error: ioerror; OffendingCommand: @image ]</p>
%%[ File: FlateDecode; Reason: Invalid compression method ]
%%[ Flushing: rest of job (to end-of-file) will be ignored ]

The letters contain image elements. I use the following code to add the images:

Aspose.Pdf.Generator.Image image = (Aspose.Pdf.Generator.Image)sec.GetObjectByID(id);
MemoryStream tiffstream = new MemoryStream(tiffdata);
tiffstream.Position = 0;
System.IO.BinaryReader reader = new System.IO.BinaryReader(tiffstream);
image.ImageInfo.ImageFileType = ImageFileType.Tiff;
image.ImageInfo.CcittSubFormat = CcittSubFormat.Group4;
image.ImageInfo.IsBlackWhite = true;
image.ImageInfo.OpenType = ImageOpenType.Memory;
image.ImageInfo.MemoryData = reader.ReadBytes((int)tiffstream.Length);
image.ImageInfo.ImageStream = tiffstream;

It is important to keep the pdf file as small as possible.

Can you shed any light on where things are going wrong?

Hi Brian,

Thank you for considering Aspose.Pdf.

I am not clear about the issue you are facing. Please create a sample application with your template PDF file to help us reproduce the issue at our end. This will help us rectify the issue soon.

Sorry for the inconvenience,

Sorry I did not close this earlier.

Our printer installed a newer version of their print software and the problem was resolved.

Hi Brian,


Thanks for the updates.

I am glad to hear that your problem is resolved. In case you have any further query, please feel free to contact.