Quantcast
Channel: Aspose.Words Product Family
Viewing all 1762 articles
Browse latest View live

Importing FootNotes/FootEndNotes Error

$
0
0
Hello!

I am having troubles trying to import a FootNote from a document into another.

I got "The newChild was created from a different document than the one that created this node"

Could you help me?

I add a screen to the post with the code.

Thank you in advance.

Hyphenation in Word document and with the document converted to PDF with Aspose are different

$
0
0
Hi,

We enabled hyphenation in Aspose.Words 16.6.0.0 by using
Aspose.Words.Hyphenation.RegisterDictionary("en-US", "hyph_en_US.dic");

(We also use hyph_da_DK.dic and hyph_en_GB.dic)

When we perform conversion to PDF we got differences in input and output files (4 lines).
var doc = new Document("input.docx");
doc.Save("output.pdf", SaveFormat.Pdf);

But we expect no differences (e.g. output pdf should be visually exact copy of the input docx).

There is another file (input2.docx) with table. The hyphenation also differs. We use dictionary hyph_da_DK.dic to convert it.

We also checked that problem exists in very latest version - 16.10.0.0


Files are attached.

ASPOSE.WORDS : save as PDF : problem with graphs

$
0
0

Hi,

I tried to save as PDF documents .docx containing graphs with ASPOSE.WORDS 14.5.0 and graphs are not correct in generated pdf.

In attacment, two exanmple of docx with graph.

Thx

Eric Hamel

devlopment ingeneer

SopraSteria

create a word merge document using a CSV

$
0
0
i have the word api for java. Im looking for examples of creating a merge document using a CSV file. Can someone point me to examples?

Replacing document styles with that from another document/template

$
0
0
Hi,

Is it possible to replace all of the styles (including built-in) from a document A with those from a different document or template B?
So if document B uses Arial as a Normal style font then document A's Normal style would also use Arial.

Thank you,

Re: Updating chart in word document

$
0
0
HI Aspose Team, 

I am also working on word doc bar chart. I have already designed bar chart, i just want to get chart label and values in c#. I just want to update the chart text and values dynamically. I need your help. I have a Aspose Total for .NET license. My client asking me to do it. I was getting same feature in  OpenXML SDK. so if you don't have such feature then what is the worth for paying you so much license fee. 

Thanks,
Tika

Text Wrapping on a Textbox object in a header

$
0
0
Hi,

We have a word document that has a "Textbox" in the header with some other text. The problem occurs while converting the word document into PDF format.

The generated PDF file is not the desired output. If you look at the Sample word document, the header and main document has the same
contents, But the generated PDF file has different output for header.

In the header, Aspose unable to wrap the other text around the "Textbox". File "Actual Issue.docx" has the screen shots.

Sample code 1 (Screen shot 1 in Actual Issue.docx):
---------------------------------------------------
using AsposeDocument = Aspose.Words.Document;

private readonly AsposeDocument m_document;

public void SaveAsPdf(Stream destinationStream)
{
m_document.Save(destinationStream, PdfSaveOptions);
}

private static PdfSaveOptions PdfSaveOptions
{
get
{
var saveOptions = (PdfSaveOptions)SaveOptions.CreateSaveOptions(SaveFormat.Pdf);
saveOptions.FontEmbeddingMode = PdfFontEmbeddingMode.EmbedNonstandard;
saveOptions.EmbedFullFonts = false;
saveOptions.ImageCompression = PdfImageCompression.Jpeg;
saveOptions.JpegQuality = 90;
return saveOptions;
}
}

Sample code 2 (Screen shot 2 in Actual Issue.docx):
---------------------------------------------------

Enforcing wrapping style:

public void SaveAsPdf(Stream destinationStream)
{

Shape shape = (Shape)m_document.FirstSection.HeadersFooters[Aspose.Words.HeaderFooterType.HeaderPrimary].GetChild(NodeType.Shape, 0, true);
shape.WrapType = WrapType.Inline;
m_document.Save(destinationStream, PdfSaveOptions);
}


Also, I have tried "WrapType.Square" but that doesn't work at all.

Aspose.Words - 16.6.0.0

Compare Multiple Word Documents

$
0
0
Hi,

I am testing Apsose Word compare functionality based on sample project "DocumentComparison.sln". 

I was wondering if  there is a way to compare more than two documents with each other? 
Do I need to create my own class to achive this or there is already something out there?

Thanks,
David

Some code from project:

"DocumentComparisonUtil."
"docCompUtil.Compare(comparisonDocument1, comparisonDocument2, comparisonDocument, ref added, ref deleted);"


Replacing hyperlinks with fields helper class.

$
0
0
Hi Team,

I  have been using below class to replace hyperlinks with static text.Can we extend/modify  the same calss to  update font of  the hyperlink(i.e now static text),so I dont want font.underline & font.color.




https://gist.github.com/aspose-words/55f18a258ff768b6c366#file-examples-csharp-programming-documents-fields-fieldshelper-fieldshelper-cs

Evaluation Only. Created with Aspose.Words. Copyright text NOT Appearing in Our Document

$
0
0
Hi,

In one of our documents that gets generated for the users, we are NOT seeing the "Evaluation Only. Created with Aspose.Words. Copyright..." line that should get generated. It is not appearing at all in our word document. I've attached a picture. The top half of the screenshot with the "X" mark shows how our Word document is appearing, which is without the copyright line, and the bottom half with the check mark shows how our generated document SHOULD appear, with the copyright line appearing after the RR Donnelley line.

We have a method that executes Tomcat initially starts up that is supposed to set the License to the one in our drive. I set a couple of print statements and breakpoints in the catch block to see what is going on. I ended up seeing a java.lang.NullPointerException: stream

Here is our code. I've also attached a second screenshot showing the same below code as well as the NullPointerException that results in the console. Could you please provide any suggestions?

static {
try {
License license = new License();
InputStream myAsposeLicenseStream = CqtInstance.class.getClassLoader().getResourceAsStream("AsposeLicense.lic");
license.setLicense(myAsposeLicenseStream);
} catch (Exception e) {
System.out.println("************************");
System.out.println(e);
System.out.println("************************");
}

Word to Searchable PDF

$
0
0
Hello,

Is it currently possible to take a Word document and convert it to searchable PDF?  Maybe by using Aspose OCR with Aspose PDF?  We have the Total product, and I'd like to be able to create a searchable pdf from a word document that was created from mail merge.  I've read posts that the Aspose OCR can't read text from PDF at this time, but I was hoping since the document was originally a Word document this may be possible.

Thanks!
Richard

Append Document generated invalid id

$
0
0
Hi 
I use the bellow code to concatenate multiple document together. 

var dstDoc = new Aspose.Words.Document(outputDocumentPath);
for (int i = firstItemIndex; i < length; i++)
{
var srcDoc = new Aspose.Words.Document(documentPaths[i]);

if (srcDoc.FirstSection.HeadersFooters.Count == 0)
{
srcDoc.FirstSection.PageSetup.HeaderDistance = 0;
srcDoc.FirstSection.PageSetup.FooterDistance = 0;
}

srcDoc.FirstSection.HeadersFooters.LinkToPrevious(false);

dstDoc.AppendDocument(srcDoc, Aspose.Words.ImportFormatMode.KeepSourceFormatting);
}

This code work fine, but when I try to concatenate 3 copies of an attached file, the generated document is corrupted and can't be opened. After some researches and changing the document finally I found the problem. In Xml of the generated document some of elements have invalid ids like attached image.
I resolved my problem by changing this ids manually. But it seams this is a bug in AppendDocument.


Re: Memory consumption issues in Aspose.Words

$
0
0
alexey.noskov:


 

Now let me explain why Aspose.Words uses more memory than document size. Document after loading into the memory is stored in DOM (Document object Model). If document contains mostly text content, Aspose.Words requires approximately 40 times more memory than the original DOCX document size (10 times more memory than DOC file size). So in your case, if your DOCX document size is 20MB, to load this document you need 800MB of memory. Then when you save document to PDF, Aspose.Words needs to build layout of the document that also stored in the memory. So I think to convert such huge document to PDF you need approximately 2GB of available memory.



Is this still an issue?

We're noticing extremely long times when trying to merge many large documents.

Paragraph followed by TOC, can't put closing bookmark between them.

$
0
0
I'm trying to place bookmarks around each paragraph in a document, so that they contain the paragraph marker. However, if the paragraph is followed by a TOC, I can't get the bookmark positioned correctly. When placing a bookmark in a paragraph, there is no option to place it AFTER the close of the paragraph marker, and if I try to move to before the TOC, the cursor gets put into a paragraph INSIDE the TOC, resulting in the bookmark containing more than desired. The documentation on MoveTo (http://www.aspose.com/api/net/words/aspose.words/documentbuilder/methods/moveto) mentions that when you use MoveTo on a block level element, it takes you to the end of the first paragraph. I found a workaround that says to move to run[0], but this is still inside of the TOC (which I think is nodetype StructuredDocumentTag). Do you know of a way to get the closing bookmark after the paragraph but before the start of the TOC?

Getting conflicts while merging the xml in different version of ASPOSE

$
0
0
Hi Team,

We are trying to merge an XML file (attached a sample xml file - SampleXML.txt) with the respective template by using two different versions of Aspose.Words.dll but we are getting two different kind of merging as shown in the attached file (IssueInstance.docx).

Version 1 : 13.8.0.0
Version 2 : 15.5.0.0

Could you please suggest is there any changes has been made in these two different versions of ASPOSE so that it is reflecting in the merge process?

Please let us know if you need any other information.

Regards,
UGSINonLinc.

output of save to pdf different than source

$
0
0
Hello,

When I'm trying to save the attached docx file as pdf using the following code, the output is incorrect:
var doc = new Document("C:\\testImage.docx"); 
        doc.Save("C:\\testImage.pdf", SaveFormat.Pdf);

When I'm saving the document as pdf from Word, the issue isn't reproducing.

Thank you,
George Radu
IBM Romania

-------
internal issue id: 12986

default font changes

$
0
0
hi - I am using c# code to insert values into bookmarks in a word document at certain places in the document. The original document font is Arial 11 but for the data at the bookmarks they are Arial 9. What I found is that the whole document is then set to Arial 9 instead of the font being changed at bookmarks. How do I fix this please? A sample of my code is included. Thank you public void InsertAt(string bookMark, System.Data.DataTable aTable, int startRow, int startCol, System.Drawing.Font defaultFont) { if (mBuilder == null) throw new Exception("Null builder"); if (bookMark == string.Empty) throw new Exception("No bookmark found in InsertAt"); if (aTable != null && aTable.Rows.Count > 0) { Aspose.Words.Tables.Table myTable = GetTable(bookMark); int tableRows = myTable.Rows.Count - startRow; int tableCols = myTable.Rows[0].Cells.Count - startCol; if (tableRows != aTable.Rows.Count || tableCols != aTable.Columns.Count) throw new Exception("Number of rows and columns do not match at InsertAt()"); mBuilder.ParagraphFormat.ClearFormatting(); for(int r=0; r < aTable.Rows.Count; r++) for (int c = 0; c < aTable.Columns.Count; c++) { myTable.Rows[startRow + r].Cells[startCol + c].FirstParagraph.Runs.Clear(); myTable.Rows[startRow + r].Cells[startCol + c].FirstParagraph.AppendChild(new Aspose.Words.Run(mDoc, aTable.Rows[r][c].ToString())); myTable.Rows[startRow + r].Cells[startCol + c].FirstParagraph.ParagraphFormat.Style.Font.Name = defaultFont.Name; myTable.Rows[startRow + r].Cells[startCol + c].FirstParagraph.ParagraphFormat.Style.Font.Size = defaultFont.Size; } } }

Adding Watermark to Document

$
0
0
Hi

I am using Aspose,Word to convert image to pdf.
In Addition I want to add watermark that will appear in all pages, 

To add the watermark  I added Shape to the Document. 
The shape has been added properly, however the image cover some part of the watermark.
Can you assist me find how to make image behind the watermark?

this is the code i wrote for adding the stamp:

            Aspose.Words.Drawing.Shape watermark = new Aspose.Words.Drawing.Shape(doc, Aspose.Words.Drawing.ShapeType.TextPlainText);
            watermark.TextPath.Text = watermarkText;
            // Create a new paragraph and append the watermark to this paragraph.
            Paragraph watermarkPara = new Paragraph(doc);
            watermarkPara.AppendChild(watermark);

this is the code i used to add image:
builder.InsertImage(image, RelativeHorizontalPosition.Page, leftPos, RelativeVerticalPosition.Page, tmpTopMargin + 20, fixedSize.Width, fixedSize.Height, WrapType.Through);

sample attached

Thx
Yaniv

The document appears to be corrupted and cannot be loaded.

$
0
0
Hi,

We are trying to do a simple task of converting a word document to a PDF file but Aspose code throws an exception:

Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. ---> System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.MemoryStream.InternalReadInt32()
at   . (Byte[] [1])
at    .[1](     [1])
at    .[1](ShapeBase [1])
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at    .[1](Document [1], LoadOptions



Here is the sample code:

using AsposeDocument = Aspose.Words.Document;

private void ConvertoPDF()
{
TextBox1.Text = "";

using (var file = File.OpenRead("sample.docx"))
{
try {
OpenDocument(file);
}
catch (Exception ex)
{
TextBox1.Text = ex.Message;
}
}
}

public void OpenDocument(Stream stream)
{
AsposeDocument m_document;

using (var ms = new MemoryStream())
{
stream.CopyTo(ms);
m_document = new AsposeDocument(ms);
}
}

I have attached the sample document as well.

Please let us know
Thanks

ConvertEffect

$
0
0
License license=new License();
license.setLicense(MyDir+"Aspose.Total.Java.lic");
Document wordDocument = new Document(MyDir + "1.doc");
wordDocument.acceptAllRevisions();
com.aspose.words.ImageSaveOptions imgSaveOptions = new com.aspose.words.ImageSaveOptions(
com.aspose.words.SaveFormat.JPEG);
imgSaveOptions.setPrettyFormat(true);
imgSaveOptions.setUseHighQualityRendering(false);
com.aspose.words.HtmlFixedSaveOptions htmlFixedSaveOptions = new com.aspose.words.HtmlFixedSaveOptions();
htmlFixedSaveOptions.setPrettyFormat(true);
htmlFixedSaveOptions.setExportEmbeddedCss(true);
htmlFixedSaveOptions.setExportEmbeddedFonts(true);
htmlFixedSaveOptions.setExportEmbeddedImages(true);
htmlFixedSaveOptions.setExportEmbeddedSvg(true);
htmlFixedSaveOptions.setWarningCallback(new com.aspose.words.IWarningCallback() {

@Override
public void warning(com.aspose.words.WarningInfo warningInfo) {
System.out.println(warningInfo.getDescription());
}
});
for (Field field : wordDocument.getRange().getFields()) {
if (field.getType() == FieldType.FIELD_HYPERLINK) {
FieldHyperlink hyperlink = (FieldHyperlink) field;
hyperlink.setTarget("_blank");
}
}

htmlFixedSaveOptions.setPageIndex(0);
htmlFixedSaveOptions.setPageCount(1);

wordDocument.save(MyDir + "Out.html", htmlFixedSaveOptions);
int pageCount = wordDocument.getPageCount();
for (int i = 0; i < pageCount; i++) {
htmlFixedSaveOptions.setPageIndex(i);
htmlFixedSaveOptions.setPageCount(1);

wordDocument.save(MyDir + "Out\\Out" + (i + 1) + "-svg.html", htmlFixedSaveOptions);
imgSaveOptions.setPageIndex(i);
imgSaveOptions.setPageCount(1);
}



License license = new License();
license.setLicense(MyDir + "Aspose.Total.Java.lic");
Presentation pptDocument = new Presentation(MyDir + "1.ppt");
int pageCount = pptDocument.getSlides().size();
ISlide pageSlide = null;
for (int i = 0; i < pageCount; i++) {
pageSlide = pptDocument.getSlides().get_Item(0);
BufferedImage bufferedImage = pageSlide.getThumbnail(1.5f, 1.5f);
ImageIO.write(bufferedImage, "jpeg", new FileOutputStream(MyDir + "Out\\Out" + (i + 1) + "-svg.jpeg"));
}


when convert doc to jpeg,the color red was not good effect..


Viewing all 1762 articles
Browse latest View live