Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Save File Using FLUSH/Force or something Else
Message
From
14/12/2017 17:25:07
 
 
To
14/12/2017 15:51:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01656416
Message ID:
01656442
Views:
54
After rewriting my PDF File(PDF file was of Text Type, not FlateDecode one) using Set Text Merge to command I am able to see all the changes I have in it, correctly.

The File opens fine and I could see everything what I needed.

But When I close it , the system is asking me "Do you want to save changes to sample.PDF".
If I select Yes, the PDF file, that was initially in Plain Text get changed to smaller size file with the Deflated code and works fine thereafter.

Is there any this I could save the file from inside my VFP code only as will need to do it for multiple files.

Currently I am using Set Merge to with Scan Scan Loop to Write the File.

I tried this VFLUSH 'D:\Sample.PDF' Force

It tried this FLUSH 'D:\Sample.PDF' Force, but an error was thrown as 'File is not open'

Will Flush or Force will work for it ? How ?

Thanks

1. What software were you using to verify the contents of the edited PDF file? Was it a text editor? Was it a PDF viewer?
2. What software was prompting you with "Do you want to save changes to sample.PDF?" Do you get same behavior with the original unmodified file? Does the same message occur with a file that was modified manually in a text editor?
3. A potential "sticking point" with files that are "simple text file" would be nature of end-of-line sequence. Some software may expect CR/LF (DOS-style) sequence, others may expect LF only (UNIX style) and sometimes CR only ( CR and LF are carriage return and line-feed respectively -- in VFP they are CHR(13) and CHR(10) ). Sometimes there may be sensitivity to presence or lack of leading or trailing blank (unless you enable viewing of end-of-line marker in text editor, diagnosing this may be difficult). It may be possible that a "blank" line needs to have at least one character - a blank. Another potential "sticking point" would be end-of-file -- the old-style CP/M and DOS style ctrl-Z end-of-file marker (e.g. CHR(26) ) could on occasion cause problems.

1. What software were you using to verify the contents of the edited PDF file? Was it a text editor? Was it a PDF viewer?

I am taking the extract of PDF in a cursor first and that Inserting my required Data. I can view and Edit it also from the NotePad.

2. What software was prompting you with "Do you want to save changes to sample.PDF?" Do you get same behavior with the original unmodified file? Does
the same message occur with a file that was modified manually in a text editor?

It is the Acrobat Reader which is Prompting me to save file, when I close it.

No I do not get the same behavior with the Original File.

Yes, the same message occur with a file that was modified manually in a text editor?

3 I have Taken Line by Line text to Excel work sheet and noticed that there invisible characters at many instances in the original File which are not in my Edited File. They seems to be CHR(10) & CHR(13) as you said earlier.

Can there be any way that I can rewrite the cursor back to file without disturbing the LF & CR

Another thing I am Still not understanding is when I am using Text Merge why the file is not saved as it is, although it me be full of errors. Instead of Cursor shall I use FILETOSTR() for my purpose ?

Thanks
Harsh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform