We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Word with Text Frame to PDF Format

Hi,

i have a document that has text frame.When i print this document in word format , there is no problem.
but when i want to print in pdf format, it deletes only , all of the text of current document, which has a text frame.
How can we solve this problem?
thnks.

Hi

Thanks for your request. Please attach your document for testing.

Also, currently there are two ways to convert Word document to PDF using Aspose.Words (SaveToPdf method, introduced in 6.0.0) and using Aspose.Words+Aspose.Pdf (old method). Which method are you using?

Best regards.

hi ,
you cant find example in attachment.
i have used old method for converting word to pdf, but when i download and tried new version of program , i have an error which i have sent my other post.
Error is:
"
“Index was outside the bounds of the array.”
"
thnks.

Hi

Thank you for additional information. I tried to convert your document using both approaches and PDF document is generated without any issues.

Best regards.

hi,
i want to learn which version of aspose you tried?
i tried to version of 5.2 which is oldversion, the problem is continued, when i delete the textframe , it prints good everything, but with textframe i cant print.
Also i cant print in new version(6.0) pdf document.
thnks.

Hi

Thanks for your request. Of course, I use the latest versions for testing. I use Aspose.Words 6.0.1 and Aspose.Pdf 3.9.0.

Best regards.

hi again,

there is no text frame problem version of you tested , but in old versions , problem continued.
However new version has a problem with drawing table with blank cells, ( i send message about this problem)
So that we must find the solution from this situations.
thnks.

Hi

Thank you for additional information. I would be great if you can provide me a code example that will allow me to reproduce the problem you mentioned.

Best regards.

I think, you can try this code and attachment with Aspose.Word old version (5.2) and you can see my problem.

Aspose.Words.Document doc = new Aspose.Words.Document(@“C:\out.doc”);
Aspose.Words.DocumentBuilder bld = new Aspose.Words.DocumentBuilder(doc);
Aspose.Words.Tables.Table tblWord = bld.StartTable();
for (int rowIndex = 0; rowIndex < 10; rowIndex++)
{
Aspose.Words.Tables.Row row = new Aspose.Words.Tables.Row(doc);

row.RowFormat.HeadingFormat = rowIndex == 0 ? true : false;
row.RowFormat.Height = 0;
row.RowFormat.LeftPadding = 1;
row.RowFormat.RightPadding = 1;
row.RowFormat.HeightRule = Aspose.Words.HeightRule.Auto;
row.RowFormat.AllowAutoFit = true;

for (int colIndex = 0; colIndex < 10; colIndex ++)
{
Aspose.Words.Tables.Cell cell = bld.InsertCell();
cell.RemoveAllChildren();
cell.CellFormat.Borders.LineWidth = 1;
cell.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single;
cell.CellFormat.Borders.Color = System.Drawing.Color.Black;
cell.CellFormat.Shading.BackgroundPatternColor = System.Drawing.Color.LemonChiffon;
Aspose.Words.Run run = new Aspose.Words.Run(doc, “Test”);
Aspose.Words.Paragraph parag = new Aspose.Words.Paragraph(doc);
parag.RemoveAllChildren();
parag.ParagraphFormat.Style.Font.ClearFormatting();
Aspose.Words.Style style1 = null;
if (doc.Styles[“Style1”] == null)
style1 = doc.Styles.Add(Aspose.Words.StyleType.Paragraph, “Style1”);
else
style1 = doc.Styles[“Style1”];
parag.ParagraphFormat.Style = style1;
parag.AppendChild(run);
cell.AppendChild(parag);
row.AppendChild(cell);
}
tblWord.Rows.Add(row);
bld.EndRow();
}
bld.EndTable();

doc.Save(@“C:\out.pdf”, Aspose.Words.SaveFormat.Pdf);

Hi

Thank you for additional information. I suppose you mean SaveFormat.AsposePdf in this case. Because there is no SaveFormat.Pdf in Aspose.Words 5.2.0. Anyway this problem does not occur when use the latest versions of Aspose.Words and Aspose.Pdf.

Best regards.

Hi,

Sorry, i use following codes for covert to pdf file.

System.IO.MemoryStream stream = new System.IO.MemoryStream();
doc.Save(stream, SaveFormat.AsposePdf);
stream.Seek(0, System.IO.SeekOrigin.Begin);

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(stream);

Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(xmlDoc, null);

pdf.IsTruetypeFontMapCached = false;

pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = System.IO.Path.GetTempPath();
pdf.Save(“Rhapsody.pdf”, Aspose.Pdf.SaveType.OpenInAcrobat, this.page.Response);

Thanks, I used the same for testing and all works fine on my side. (with Aspose.Words 6.0.1 and Aspose.Pdf 3.9.0)

Best regards.

Ok, thank you. I m waiting for your answer.