Problems with the saving of some pdf files to a stream (V.8)

Discussions about PDF management.
Post Reply
ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Problems with the saving of some pdf files to a stream (V.8)

Post by ebbiTeam » Tue Jun 28, 2011 11:54 am

Hello,

I'm testing your new V8 right now and was so happy about the implementation of these new pdf native manipulation functions.

After trying some pfd documents I've found out a problem with the saving. With the SaveToFile-method some files (e.g. GdPicture.NET8.pdf) are not readable. The usage of the SaveToFileInc-method solved this issue.
Now for our implementation we need a stream of the loaded pdf document and unfortunately it seems that there's no äquivalent method for the SaveToStream-method. :( The result is that the saved file from stream is again unreadable.

To sum it up: Reading e.g. your documentation pdf, writing it to stream and then saving this stream to file does not work. Is there any method to get it working? Rasterization is no alternative because of the loss of searchability.

Best regards
Tobias Herold

P.S. Am I right that the problematic documents all have PDF-Version 1.5?

ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Re: Problems with the saving of some pdf files to a stream (

Post by ebbiTeam » Tue Jun 28, 2011 12:15 pm

Update:
I have now found out a strange behaviour.
The reading problem only regards the version of Adobe Acrobat Reader I'm using (8.1.2).
I can open the document with your sample document viewer as well as with Acrobat Reader X and Adobe Reader V.9.
The original file is readable everywhere.

Do you have an explanation for this?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Problems with the saving of some pdf files to a stream (

Post by Loïc » Tue Jun 28, 2011 12:44 pm

Hi,

Could you provide a code snippet that reproduces your problem ?

I will try to find a copy of adobe reader 8 but the same time.

Kind regards,

Loïc

ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Re: Problems with the saving of some pdf files to a stream (

Post by ebbiTeam » Tue Jun 28, 2011 1:10 pm

Thank you for the fast help.

Here's the relevant code snippet:

Code: Select all

pdfManaging.LoadFromFile("[filepath]", True)
        Dim mem As New System.IO.MemoryStream()
        
        pdfManaging.SaveToStream(mem)
        Dim fmem As System.IO.FileStream
        fmem = New System.IO.FileStream("[filepath]", IO.FileMode.Create)
        mem.Position = 0

        For i As Integer = 0 To mem.Length - 1
            fmem.WriteByte(mem.ReadByte())
        Next

        fmem.Close()

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Problems with the saving of some pdf files to a stream (

Post by Loïc » Tue Jun 28, 2011 1:11 pm

thx,

I can confirm the issue with reader 8. We are on investigation. You can expect a fix very quickly.

Kind regards,

Loïc

ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Re: Problems with the saving of some pdf files to a stream (

Post by ebbiTeam » Tue Jun 28, 2011 3:57 pm

Thank you very much - I'm curious. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest