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 Dec 27, 2018 7:19 am

hello,
in my version (spire office 3.6.0) there is still the limit of 50 pages for each pdf file.
Is there the possibility to overstep this limit?
thank you,

Paola

paolagumi
 
Posts: 85
Joined: Tue Apr 21, 2015 11:32 am

Thu Dec 27, 2018 8:01 am

Dear Paola,

Thanks for your inquiry.
Please kindly note that our commercial version has no limitation. I tested a Pdf file which has 140 pages with Spire.Office 3.6.0 ( Spire.Pdf.dll:4.5.9.14040), and it works well. To help us further investigate your issue, please provide your input Pdf file as well as you full code. Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Dec 27, 2018 8:20 am

Hello Lisa,
in doubt,
I've also just downloaded Spire.office (because I need spire.doc and spire.pdf) version 3.12.3, which I see as the latest downloadable version.
In this version (net 4.0 client profile) I have:
Spire.pdf dll version: 4.12.7.2041,
Spire.pdf runtime version: v4.0.30319.

In version 3.6.0 I have:
Spire.pdf dll version: 4.5.9.140.41,
Spire.pdf runtime version: v4.0.30319.

Both version, 3.6.0 and 3.12.3 give me the problem of max 50 pages par pdf.
I send you attached a pdf file of 86 pages.
In this pdf, the top 36 page result empty (the remaining 50 are ok), if I prepare two files of 50 and 36 files, of course they are ok.

Please let me know what I can do.
thank you,
Paola

paolagumi
 
Posts: 85
Joined: Tue Apr 21, 2015 11:32 am

Thu Dec 27, 2018 9:01 am

Dear Paola,

Thanks for your quick reply.
I did notice the issues of your Pdf file. How did you generate it? Please share us with your testing code as well as your original input files(if you have)? Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Dec 27, 2018 9:06 am

Hello Lisa,
this is the code which joins two pdf files,
I replicate it for all the files I find in my "PathPdf":

Friend Function UnionePdf(ByVal PathPdf As String, ByVal LettereTossicologiche As String, ByVal LetteraAgente As String) As Boolean

UnionePdf = True

If Not My.Computer.FileSystem.FileExists(PathPdf & "\" & LettereTossicologiche) Then
Dim documentovuoto As New PdfDocument()
documentovuoto.LoadFromFile(PathPdf & "\" & LetteraAgente)
documentovuoto.SaveToFile(PathPdf & "\" & LettereTossicologiche)
documentovuoto.Close()
documentovuoto.Dispose()
documentovuoto = Nothing
Else
Dim files As String() = New String() {PathPdf & "\" & LettereTossicologiche, PathPdf & "\" & LetteraAgente}
Dim doc As PdfDocumentBase = PdfDocument.MergeFiles(files)
doc.Save(PathPdf & "\" & LettereTossicologiche, Spire.Pdf.FileFormat.PDF)
doc.Dispose()
'System.OutOfMemoryException
doc.Close()
doc = Nothing
End If

End Function

paolagumi
 
Posts: 85
Joined: Tue Apr 21, 2015 11:32 am

Thu Dec 27, 2018 9:11 am

here attached you see an examplel of a pdf and of the same in a docx version of one of the files which should be merged,
thank you,
Paola

paolagumi
 
Posts: 85
Joined: Tue Apr 21, 2015 11:32 am

Thu Dec 27, 2018 10:44 am

Hello Lisa,
I found a solution!!!
Here it is:

Friend Function UnionePdf(ByVal PathPdf As String, ByVal LettereTossicologiche As String, ByVal LetteraAgente As String) As Boolean

UnionePdf = True

If Not My.Computer.FileSystem.FileExists(PathPdf & "\" & LettereTossicologiche) Then
Dim documentovuoto As New PdfDocument()
documentovuoto.LoadFromFile(PathPdf & "\" & LetteraAgente)
documentovuoto.SaveToFile(PathPdf & "\" & LettereTossicologiche)
documentovuoto.Close()
documentovuoto.Dispose()
documentovuoto = Nothing
Else

' max 50 pages:
'Dim files As String() = New String() {PathPdf & "\" & LettereTossicologiche, PathPdf & "\" & LetteraAgente}
'Dim doc As PdfDocumentBase = PdfDocument.MergeFiles(files)
'doc.Save(PathPdf & "\" & LettereTossicologiche, Spire.Pdf.FileFormat.PDF)
'doc.Dispose()
'System.OutOfMemoryException era già commentato
'doc.Close()
'doc = Nothing

' unlimited pdf pages:
Dim files As String() = New String() {PathPdf & "\" & LettereTossicologiche, PathPdf & "\" & LetteraAgente}
Dim docs(files.Length - 1) As PdfDocument
docs(0) = New PdfDocument(files(0))
docs(1) = New PdfDocument(files(1))
docs(0).InsertPage(docs(1), 0)
docs(0).SaveToFile(PathPdf & "\" & LettereTossicologiche, Spire.Pdf.FileFormat.PDF)

docs(0).Dispose()
docs(0).Close()
docs = Nothing
files = Nothing

End If

End Function

Thank you anyway,
best regards
Paola

paolagumi
 
Posts: 85
Joined: Tue Apr 21, 2015 11:32 am

Thu Dec 27, 2018 11:06 am

Dear Paola,

Glad to hear that you resolved the issue. If you need other helps, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF

cron