Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Mar 17, 2016 11:32 am

I have a problem when I try this code.

Code: Select all
Dim result As PdfTextFind() = Nothing
result = doc.Pages.Item(i).FindText("Serie").Finds



This return an error.
When I have a pdf without changes it works, but when I try with the same pdf which I replace a image and save it fails.

Code: Select all
Dim page As PdfPageBase = doc.Pages(i)
fls = New FileStream(filename, FileMode.Open, FileAccess.Read)
image = PdfImage.FromStream(fls)
fls.Close()
page.ReplaceImage(cantidadFirmas(_folderOrigen & "\" & filePdf) + 1, image)
doc.SaveToFile(_folderOrigen & "\" & filePdf, FileFormat.PDF)


Can you help me?
Thanks.
Best Regards.

javierfs
 
Posts: 4
Joined: Wed Mar 16, 2016 2:58 pm

Thu Mar 17, 2016 12:28 pm

This is the Error Message:

System.FormatException:
{"La cadena de entrada no tiene el formato correcto."} ({ "The input string does not have the correct format."})

StackTrace:
en System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
en System.Single.Parse(String s)
en Spire.Pdf.PdfPageBase.ᜄ(String[] A_0)
en Spire.Pdf.PdfPageBase.ExecuteCommandFindText(String searchPatternText)
en Spire.Pdf.PdfPageBase.FindText(String searchPatternText)

This only happens when the documents have been save or modify one time.

javierfs
 
Posts: 4
Joined: Wed Mar 16, 2016 2:58 pm

Fri Mar 18, 2016 2:48 am

Hello,

Thanks for your feedback.
Please attach the document here for our testing.
Thanks in advance.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri Mar 18, 2016 8:27 am

This is the document. I want to replace the gray image with another image but it doesn't works.

prueba_firma_gris_2.zip

javierfs
 
Posts: 4
Joined: Wed Mar 16, 2016 2:58 pm

Fri Mar 18, 2016 9:20 am

Hello,

Thanks for your document. I tested your document with the following code and Spire.Pdf 3.6.167.5040, but I can replace the gray image with another image. This is the generated document.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Thu Mar 24, 2016 5:55 am

Hello,

Has your issue been resolved? Thanks for your feedback.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Return to Spire.PDF