ParagraphItemCollection supresses blanks

Technical support for Spire.Doc

Moderator: iceblue support

ParagraphItemCollection supresses blanks

Postby mbi GmbH » Thu Jun 20, 2013 9:06 am

Hello,

by iterating through the items of a ParagraphItemCollection and concatanating the textvalues somtimes it happens that blanks are supressed within the text.
I have the following example. My rtf file (see attachment) contains a text like:
"wurden aktualisiert und liegen am Sitz der Emittentin, der 3 Banken-Generali Investment"

Now I try to find the layoutproperties of the text. The way I solved the problem was to take a paragraph, get the ParagraphItemCollection of the paragraph, iterating over the textRangeItems and using the characterformatattributes for further calculating steps. Inspecting the Textproperty of the paragraph I can see the following:
"wurden aktualisiert und liegenam Sitz der Emittentin, der 3 Banken-Generali Investment".

As you can see there is a blank missing between "liegen" and "am".

Could you please help me to detect the places where the blanks are missing.

I attach the examplefile.

Thank you for your efforts.

Greetings
You do not have the required permissions to view the files attached to this post.
mbi GmbH
 
Posts: 11
Joined: Mon Feb 25, 2013 9:52 am

Re: ParagraphItemCollection supresses blanks

Postby Gary.zhang » Fri Jun 21, 2013 2:35 am

Hello,

Thanks for your inquiry.

We tested with the newest Spire.Doc Dll, there is no blank missing between "liegen" and "am", please download and test the Spire.Doc4.9.4 from http://www.e-iceblue.com/Download/download-word-for-net-now.html.

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: ParagraphItemCollection supresses blanks

Postby mbi GmbH » Mon Jun 24, 2013 10:25 am

Hello,

I tried the actual Version and as you said the problem was fixed.

But with the actual version of Spire.doc there is an new obligatory reference to Spire.pdf if the word document contains images.

If I try to read an rtf-File with a containig image I get the following exception:
"System.TypeInitializationException"

within line document.LoadFromFile(file + ".rtf");

With innerException
"{"Die Datei oder Assembly \"Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3\" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.":"Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3"}"

I try to translate:
"The file or assemby "Spire.Pdf" or a dependency could not be found. The system can't find the file "Spire.pdf"

I am sure this dependency was not necessary in former versions I used when processing documents with graphics.

Could you please tell me why I now need spire.pdf?

Best regards.

Mark Remlinger
mbi GmbH
 
Posts: 11
Joined: Mon Feb 25, 2013 9:52 am

Re: ParagraphItemCollection supresses blanks

Postby Gary.zhang » Tue Jun 25, 2013 1:48 am

Hello Mark,

Thanks for your feedback.
Sorry for inconvenience. We didn't reproduced the issue with an rtf-File with a containig image and the Spire.doc4.9.4. Please provide us the rtf file so that we could reproduce the issue and work out the solution for you ASAP.

Thanks,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: ParagraphItemCollection supresses blanks

Postby mbi GmbH » Wed Jun 26, 2013 8:06 am

Hi,

can reproduce the problem with every rtf-file conatainig a graphic.

I did not install spire. I just use the spire.doc.dll and the Spire.License.dll as references of my project. The dll-files are copied to a special lib-folder.

I added the spire.pdf.dll to my library-directory and to my project. The I tried to read my rtf-file containig a graphic. And the everythings ok.

There must be a reference to a spire.pdf.dll in the spire-doc.dll. Here is the Stacktrace of the Exception:

System.TypeInitializationException wurde nicht behandelt.
HResult=-2146233036
Message=Der Typeninitialisierer für "sprᨀ" hat eine Ausnahme verursacht.
Source=Spire.Doc
TypeName=sprᨀ
StackTrace:
bei sprᨀ..ctor()
bei spr᳝..ctor(Document A_0)
bei sprជ..ctor(DocumentBase A_0)
bei sprᡓ..ctor(IDocument A_0)
bei spr᧿..ctor(IDocument A_0)
bei Spire.Doc.Fields.DocPicture..ctor(IDocument doc)
bei Spire.Doc.Document.CreateParagraphItem(ParagraphItemType itemType)
bei Spire.Doc.Documents.Paragraph.ᜀ(ParagraphItemType A_0)
bei Spire.Doc.Documents.Paragraph.AppendPicture(Byte[] imageBytes)
bei sprᶈ.ᜆ(String A_0)
bei sprᶈ.ᜏ()
bei sprᶈ.ᜉ(String A_0)
bei sprᶈ.ᜢ()
bei Spire.Doc.Document.ᜁ(Stream A_0, Encoding A_1)
bei Spire.Doc.Document.ᜍ(Stream A_0)
bei Spire.Doc.Document.LoadFromFile(String fileName, FileFormat fileFormat, String password)
bei Spire.Doc.Document.ᜀ(String A_0, String A_1)
bei Spire.Doc.Document.LoadFromFile(String fileName)
bei XMLConverter.Form1.button1_Click_1(Object sender, EventArgs e) in c:\Projekte\Bundesanzeiger\RELEASE\3.7.0\source.Client\XMLConverter\XMLConverter\Form1.cs:Zeile 31.
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei XMLConverter.Program.Main() in c:\Projekte\Bundesanzeiger\RELEASE\3.7.0\source.Client\XMLConverter\XMLConverter\Program.cs:Zeile 18.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileNotFoundException
HResult=-2147024894
Message=Die Datei oder Assembly "Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Source=Spire.Doc
FileName=Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3
FusionLog==== Zustandsinformationen vor Bindung ===
LOG: Benutzer = MBI\Mark Remlinger
LOG: DisplayName = Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3
(Fully-specified)
LOG: Appbase = file:///C:/Projekte/Bundesanzeiger/RELEASE/3.7.0/source.Client/XMLConverter/XMLConverter/bin/Debug/
LOG: Ursprünglicher PrivatePath = NULL
Aufruf von Assembly : Spire.Doc, Version=4.9.4.3040, Culture=neutral, PublicKeyToken=663f351905198cb3.
===
LOG: Diese Bindung startet im default-Load-Kontext.
LOG: Es wurde keine Anwendungskonfigurationsdatei gefunden.
LOG: Die Hostkonfigurationsdatei wird verwendet:
LOG: Die Computerkonfigurationsdatei von C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config wird verwendet.
LOG: Verweis nach der Richtlinie: Spire.Pdf, Version=2.8.26.3040, Culture=neutral, PublicKeyToken=663f351905198cb3
LOG: Die gleiche Bindung ist bereits aufgetreten und hat den Fehler hr = 0x80070002 verursacht.

StackTrace:
bei spr⅑.ᜈ(Double A_0)
bei sprᨀ..cctor()
InnerException:

Thank you
You do not have the required permissions to view the files attached to this post.
mbi GmbH
 
Posts: 11
Joined: Mon Feb 25, 2013 9:52 am

Re: ParagraphItemCollection supresses blanks

Postby Gary.zhang » Wed Jun 26, 2013 10:53 am

Hello,

It is not necessary that adding the Spire.pdf dll as references of the project, if it needs to use the DLL, it would search the Spire.pdf dll in the same directory as the Spire.doc automaticly. Please refer to the demo in the attachment.

If there are any questions, welcome to get it back to us.

Thanks,
Gary
E-iceblue support team
You do not have the required permissions to view the files attached to this post.
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: ParagraphItemCollection supresses blanks

Postby mbi GmbH » Fri Jun 28, 2013 7:15 am

Hi,

thanks for your answer.

Adding Spire.PDF may solve the Problem, but we do not own a Spire.pdf licence. Only one for Spire.doc.

Is it ok to deploy a Spire.pdf-dll without owning a licence?

Greetings.

Mark Remlinger
mbi GmbH
 
Posts: 11
Joined: Mon Feb 25, 2013 9:52 am

Re: ParagraphItemCollection supresses blanks

Postby Gary.zhang » Fri Jun 28, 2013 9:00 am

Hello Mark,

Thanks for your feedback.

You own a licence for Spire.doc, so it is ok to deploy all the dll files in the Spire.doc file.

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar
Gary.zhang
 
Posts: 1390
Joined: Thu Apr 04, 2013 1:30 am

Re: ParagraphItemCollection supresses blanks

Postby amy.zhao » Wed Jul 03, 2013 9:53 am

Dear Mark,

Has this issue been resolved?
Please give us a feedback message at your early convenience.

Regards,
Amy
E-iceblue support team
User avatar
amy.zhao
 
Posts: 2279
Joined: Wed Jun 27, 2012 8:50 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 2 guests