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?