Unable to save documents to file stream

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
chavas
User
Posts: 141
Joined: Tue Mar 15, 2016 12:21 pm

Unable to save documents to file stream

Post by chavas »

Hi,

In my project, we store files in SQL filestream. We read the byte array from file stream and using your IStreamWrapper class open the pdf file in PDF Editor. After editing, we save the file to memory stream (using Istreamwrapper) and store it back in SQL. This works fine for some pdfs. However for pdfs with fillable forms, the file does not save properly. I have some samples of PDF files which fail. I have created a a sample project to reproduce this issue. We work on Visual Studio 2013 and vb.net. The sample project is too big to upload on forum. Can you give me an email to send it to you?
Here is the code-
Step1- Select file and convert to byte array-Dim fStream As New FileStream(FileName, FileMode.Open, FileAccess.Read)
Dim br As New BinaryReader(fStream)
Data = br.ReadBytes(CInt(numBytes))

Step2- Open pdf in editor- Dim srcstream As New MemoryStream
srcstream.Write(data, 0, data.Length)
Dim srcIStream As IStreamWrapper = New IStreamWrapper(srcstream)
pdfctrl.OpenDocFrom(srcIStream)

Step3- Save pdf to memory stream and then to disk- Dim fs As New MemoryStream()
Dim srcIStream As IStreamWrapper = New IStreamWrapper(fs)
pdfctrl.Doc.Save(srcIStream, 1)
pdfctrl.Doc.Close()
srcIStream = Nothing
Dim docBytes As Byte()
docBytes = fs.ToArray()
File.WriteAllBytes("C:\123.pdf", docBytes)

In the sample, Click on 'Viewer' button to open the PDF Editor. Here click on 'Step1' to select a file and convert to byte array. Then click on step2 to open pdf in editor. Edit the pdf, then click on 'Save' to save the document at 'C:\123.pdf'. The new file gets corrupted.
We are using PDF-XChange Editor V6.0.322.4

Appreciate your help on this..

Charu
Attachments
PDFFiles.zip
(1.03 MiB) Downloaded 66 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Unable to save documents to file stream

Post by Sasha - Tracker Dev Team »

Hello chavas,

You can mail the sample to me directly:
polaringu@tracker-software.com

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chavas
User
Posts: 141
Joined: Tue Mar 15, 2016 12:21 pm

Re: Unable to save documents to file stream

Post by chavas »

Hi Alex,

I have emailed you the project. To run the project, place the -PDFXEditCore.x86.dll , pluginsX86 folder in bin\debug folder of the project.


Rgds
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Unable to save documents to file stream

Post by Sasha - Tracker Dev Team »

Hello chavas,

We've managed to reproduce the problem in FullDemo application and are investigating it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chavas
User
Posts: 141
Joined: Tue Mar 15, 2016 12:21 pm

Re: Unable to save documents to file stream

Post by chavas »

Hi Alex,

Any progress on the issue?

Rgds
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Unable to save documents to file stream

Post by Sasha - Tracker Dev Team »

Hello chavas,

Yup, we've found a problem and will try to fix this. I will notify you when it's fixed.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Unable to save documents to file stream

Post by Sasha - Tracker Dev Team »

Hello chavas,

The Memory Stream problem is fixed now - you can try the latest Dev. Build here in an hour or so from this post:
https://forum.pdf-xchange.com/ ... 66&t=25943

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
chavas
User
Posts: 141
Joined: Tue Mar 15, 2016 12:21 pm

Re: Unable to save documents to file stream

Post by chavas »

Alex,

Thank you...we will get it checked on our sample files and get back to you.
BTW, when will the final build be available?

Rgds
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17889
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Unable to save documents to file stream

Post by Tracker Supp-Stefan »

Hello Chavas,

Do let us know how it goes once you've had the chance to test!
As for the official release of build 323 - it's still a few weeks away - and there's no specific date set up for it yet.

Regards,
Stefan
chavas
User
Posts: 141
Joined: Tue Mar 15, 2016 12:21 pm

Re: Unable to save documents to file stream

Post by chavas »

Hi Alex,

We have verified, the issue is fixed in the development build. Now we are waiting for the final build. We use PDFXEditor in our software and our final release is stuck because of this issue.
Hence we request you to give us final build at the earliest.

Rgds
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Unable to save documents to file stream

Post by Will - Tracker Supp »

Hi Chavas,

Thanks for the post and the info. - We do not provide builds earlier than their intended release date. All users will have access to the build at the same time. We don't release builds early to ensure that all features and fixes are up to 'par' and that there are no major issues.

Thanks,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply