Free Support Forum - aspose.com

SaveTpPdf Rendering Of Drawing Shapes

Hi


Can you please let me know when you are going to support drawing shapes properly when saving to PDF.

For starters, the following causes problems:

1) Any textbox (Shape newTextBox = new Shape(builder.Document, ShapeType.TextBox)) is not rendered properly - the box seems to be there but the text is not visible.

2) Fill colors do not appear to be supported on rectangle shapes.

I think these are fairly basic things and it would be great to have these supported.

Thanks

Mike

Hi Mike,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please provide me simple code and attach sample documents, which will allow me to reproduce the problems on my side? I will check the issues on my side and provide you more information.

Best regards.

Hi


I am attaching an example - it is very simple to reproduce.

Mike

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Actually, the problem occurs because you specified width of the textbox but did not specify its height. For instance, try the following code:

newTextBox.Width = 200;

newTextBox.Height = 100;

And what about your second problem? Could you please provide me simple code or document, which will allow me to reproduce it?

Best regards.

Hi


Thanks for the quick response.

I have attached a new project. Can you please explain why the text is not visible in the pdf and the rectangle fill color is not honoured.

Mike

Hi Mike,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I managed to reproduce the problem on my side you will be notified as soon as it is resolved.

It seems the problem occurs because you specified transparent background of textbox. If you remove the highlighted line of code, the problem does not occur.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

GroupShape parentShape = new GroupShape(builder.Document);

parentShape.Width = 600;

parentShape.Height = 600;

builder.InsertNode(parentShape);

Shape newTextBox = new Shape(builder.Document, ShapeType.TextBox);

parentShape.AppendChild(newTextBox);

newTextBox.Width = 300;

newTextBox.Height = 200;

newTextBox.FillColor = Color.Empty; // if remove this line of code text and filling is visible.

Paragraph para = new Paragraph(builder.Document);

newTextBox.AppendChild(para);

builder.MoveTo(newTextBox.FirstParagraph);

builder.Write("Hello");

//2nd Problem

Shape newShape = new Shape(builder.Document, ShapeType.Rectangle);

parentShape.AppendChild(newShape);

newShape.Left = 350;

newShape.Width = 200;

newShape.Height = 200;

newShape.FillColor = Color.Blue;

doc.Save(@"c:\temp\test.doc", SaveFormat.Doc);

doc.Save(@"c:\temp\test.pdf", SaveFormat.Pdf);

Hope this helps.

Best regards.

Thanks Alexey


I suspected it might be that. I need to use textboxes on top of other shapes so the empty fill is a necessity for us.

Did you have an answer to the second part - the rectangle shape not having the proper fill color? I put the code in for that, too.

Mike


Hi Mike,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. For some reason fill color of textbox affect fill color of the other shape. As I mentioned in my previous answer, if remove line of code, which specifies fill color of textbox, text and fill color of the other shape will be displayed properly.

Best regards.

Hi Alexey


Yes, I see. You had removed my other rectangle which is drawn ‘underneath’ the text box. I note that if this rectangle has an empty fill color, the same thing happens even if the text box does not have the empty fill color. So clearly this is at the root of the problem.

Anyway, thanks for your help and I look forward to an update.

Mike

Hi Mike,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your inquiry. I removed it just to simplify the example. The problem seems to be related to Color.Empty. If specify another color all works fine.

Best regards.

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


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