Two SaveToPdf bugs : TextBox Layout and Image file size

Hi,

Using Aspose.Words 6.2.0.0 and the attached Word document, I run the following code.

Aspose.Words.Document doc = new Aspose.Words.Document(“asposeWordTest04.doc”);
doc.Save(“c:\temp\asposeWords04.pdf”, Aspose.Words.SaveFormat.Pdf);

Two problems arise :

1- The Top and Bottom Layout (Text wrapping settings) of the TextBox is
ignored and the first column of text appears moved up on the page,
resulting in some text overlap (see attached pdf)

2- The word document is 131 KB, the resulting PDF is 650 KB. Why is that ? The original image is a JPG of 92 KB.

One last question :
3- Is there any difference between the two following lines of code?

doc.Save("c:\temp\asposeWords04.pdf", Aspose.Words.SaveFormat.Pdf);
doc.SaveToPdf("c:\temp\asposeWords04.pdf");

I noticed that Save() also works fine with HttpResponse but SaveToPdf needs a intermediate MemoryStream to work. (The resulting file size seems to also be bigger…)

Thanks for your support,

dstj.

  1. Text wrapping around images or tables is not supported in Aspose.Words rendering at the moment. Hopefully this will be supported later in 2009. Issue #7180.
  2. On my latest code the resulting PDF is only 56.1KB. We’ve made a fix that the images that are originally JPEG saved to PDF as JPEG. In your version it is converted to PNG hence the big size. Will be released later in March.
  3. There is no difference between Document.Save(“myfile.pdf”) and Document.SaveToPdf(“myfile.pdf”); Document.SaveToPdf is just a newer family of methods that can accept parameters specific to PDF export (e.g. PdfOptions). I get the same file size in both methods, in fact one just calls another.

Thanks for your answers.

  1. Ok, I’ll try to do it with numerous skipped lines and a “above text” text-box.

  2. Any chance I can get a preview of this upcoming version? It would really help me with my tests…

  3. Why then do I get a this Exception

[NotSupportedException: Specified method is not supported.]
System.Web.HttpResponseStream.get_Position() +29

() +44 
() +21 
.WriteToPdf( writer) +18

() +35

.VisitPageEnd( page) +12

.Accept( visitor) +36

Aspose.Words.Document.SaveToPdf(Int32 pageIndex, Int32 pageCount, Stream stream, PdfOptions options) +473

when calling :

response.Clear();
response.ContentType = "application/pdf";
response.AddHeader("content-disposition","attachment; filename=" + filename);
doc.SaveToPdf(0, doc.PageCount, response.OutputStream, null);
response.End();

by not when calling

response.Clear();
doc.Save(filename, Aspose.Words.SaveFormat.Pdf, Aspose.Words.SaveType.OpenInWord, response);
response.End();

Thanks a lot,

dstj.

  1. Sorry no preview. It will take longer for us to prepare, build and go back and forth than to just release some time next week.
  2. You cannot use any Document.Save to write to response.OutputStream directly because http output stream does not support random access (positioning). http output stream is only sequential write stream.
    The Document.Save method that accepts an HttpResponse was explicitly designed to help with that. Internally, it saves into a memory stream first and then copies to http output.

Thanks a lot for the precision, I’ll wait.

Might I suggest then throwing an exception that’s a little more precise than the default “Not supported exception”. It would help us fix our code when encountering this situation…

Thanks, noted as #7862.

The issues you have found earlier (filed as 7861) have been fixed in this update.

Thanks, but the issues in this thread are 7180 and 7162.

From the release note, 7861 does not seem to be what I reported.
7861 Bug Layout Saving the same document twice to PDF causes exception

Are you perhaps referring to :
7657 Bug Rendering.PDF File size is very big after converting to PDF.

My tests indicate that this one is fixed in v6.3.0.0.

Thanks.

Dominic.

Hi Dominic,

I posted notification here because this thread was linked to the issue. Most likely, we reproduced this problem with your document. Sorry for inconvenience.
Best regards.

Hi,

Can you have any update on issue #7180:

1. Text wrapping around images or tables is not supported in
Aspose.Words rendering at the moment. Hopefully this will be supported
later in 2009. Issue #7180.

Using version 7.0.0.0, I notice that it is still not supported.

Thanks,

dstj.

Hi

Thanks for your request. Unfortunately, currently, the issue still unresolved, and I cannot provide you any reliable estimate regarding this feature. Text wrapping is very complex feature. Most likely, this feature will be supported somewhere in the first half of the next year.
Best regards,

We are happy to tell you that a very cool and important feature (filed as 7180) is included in the new version of Aspose.Words. Text wrapping around images and shapes when rendering Microsoft Word documents to PDF, XPS and printing is now supported. You can download the latest version from here.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(105)