Does anyone know of way to convert the XML word documents created by export in SAM7 to a read only format such as PDF.
I have tried a couple of convertors with no success
Any help appreciated.
Printable View
Does anyone know of way to convert the XML word documents created by export in SAM7 to a read only format such as PDF.
I have tried a couple of convertors with no success
Any help appreciated.
How about printing them using the XPS or Office document writer that most computers have pre-installed under printers. This would probably take a while though if you've got a lot of documents to print.
Hmm i considered this, I allready use various Printer type PDF convertors but i can t find a way a do it in batch (we are a school of 1750 students)
I need something like this to convert a batch of .xml documents from SIMS profiles to .pdf / .doc.
I've had a look about on the internet and nothing appears to do the job we want.
Capita are currently looking at this issue so that reports can be saved to Pupil Records in PDF or similar format rather than the original Word doc.
So watch this space .............
I have found a way to do this.
Using pdf995 (pdf 995: create PDF documents easily for free) The full version not the ad supported one
You have to change the file extensions to .doc but it then works in batch mode!!!
I am happy!!! at least until Capita give us the option to export as PDF which would, lets face it) be more sensible.
The other way to do it would be to protect the file contents (I think word can do this) by a bit of vb after they've been created. Batch converting has got to be the easiest option though.
I'm sure i managed to do this using the free version or maybe i found another tool. It was a long time ago. In fact i think i found lots of tools recommend here on EduGeek. pdf995 has this other program called omniformat with it doesn't it? I think that's still free.
Also, try primopdf i think that had some bulk options. maybe it was only for a trial period.
I'm not quite sure why you want a read only format apart from the size is smaller than the xml. We used to store our reports in a folder structure because we proof read and corrected them after export. Now we correct them in sims and use the document storage.
I had a few scripts that would convert the files to .doc format. There weren't any available so i made my own but it was a pain. Much easier to do a bulk rename to .doc with a little vbscript, though it keeps the xml size.
The other reason for having them as .doc is that you can bulk print them from a folder which you can't do with the .xml, though there is a tweak you can do to the registry so that print is an option on the right click context menu.
Does anyone Know if Capita ever introduced this feature ?
I have a VBS script that will convert them to DOC, also there's one for printing on batch (created by another EduGeek member - can't remember who!)
You could use the printing one to do the job, just set BullZip (or some other PDF printer) as default and run them off any batch that way
here's the one to convert to DOC:
and the script to print:Code:'==========================================================================
'
' NAME: Word XML to DOC.vbs
'
' AUTHOR: Josh Johnson
' DATE : 04/02/2011
'
' COMMENT: Convert SIMS XML files in to XLS files
' HOW TO USE: Drag a folder containing the XML files onto the script.
'==========================================================================
Option Explicit
On Error Resume Next
Dim Arg 'Script argument
Dim FSO 'File System Object
Dim oFol 'Folder object
Dim oFil 'File object
Dim oFils 'Files
Dim myWord 'Word object
Dim myDoc 'Document object
Dim filePath 'Path to file (need for Word to open the file)
'Check arguments
If WScript.Arguments.Length < 1 Then
MsgBox "Drag a folder containing Word XML files onto this script", vbOKOnly, "Error!"
WScript.Quit
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
Arg = WScript.Arguments(0)
If FSO.FolderExists(Arg) = False Then
MsgBox "Drag and drop a folder onto this script to print the contents."
Set FSO = Nothing
WScript.Quit
End If
Set myWord = CreateObject("Word.Application")
myWord.Visible = True
myWord.Application.DisplayAlerts = False
'Get folder informaton
Set oFol = FSO.GetFolder(Arg)
Set oFils = oFol.Files
For Each oFil in oFils '-- enumerate files in the folder using For/Each. Each oFil is a File object.
filePath = oFil
Set myDoc = myWord.Documents.Open(filePath, True, True, False, , , False, , , 8, , True)
myDoc.SaveAs oFol.Path & "\" & left(FSO.GetFileName(oFil), Len(FSO.GetFileName(oFil))-4) & ".doc", 0
myDoc.Close
oFil.Delete
If Err <> 0 Then MsgBox "Error converting " & FSO.GetFileName(oFil) & vbNewLine & Err.Description, vbOKOnly, "Error"
Err.Clear
Set myDoc = Nothing
Next
myWord.Application.Quit
Set myWord = Nothing
Set oFils = Nothing
Set oFol = Nothing
MsgBox "Complete!", vbOKOnly, "Converting done"
Function strClean (strtoclean)
Dim objRegExp, outputStr
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "[(?*"",\\<>&#~%{}+_.@:\/!;]+"
outputStr = objRegExp.Replace(strtoclean, "-")
objRegExp.Pattern = "\-+"
outputStr = objRegExp.Replace(outputStr, "-")
strClean = outputStr
End Function
EDIT:Code:'==========================================================================
'
' NAME: WordXMLPrint.vbs
'
' AUTHOR: Jim Williams
' DATE : 30/04/2007
'
' COMMENT: Batch prints Word XML files.
' HOW TO USE: Drag a folder containing the XML files onto the script.
'==========================================================================
Option Explicit
Dim Arg 'Script argument
Dim FSO 'File System Object
Dim oFol 'Folder object
Dim oFil 'File object
Dim oFils 'Files
Dim myWord 'Word object
Dim filePath 'Path to file (need for Word to open the file)
'Check arguments
If WScript.Arguments.Length < 1 Then
MsgBox "Drag a folder containing Word XML files onto this script", vbOKOnly, "Error!"
WScript.Quit
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
Arg = WScript.Arguments(0)
If FSO.FolderExists(Arg) = False Then
MsgBox "Drag and drop a folder onto this script to print the contents."
Set FSO = Nothing
WScript.Quit
End If
Set myWord = CreateObject("Word.Application")
myWord.Visible = True
'Get folder informaton
Set oFol = FSO.GetFolder(Arg)
Set oFils = oFol.Files
For Each oFil in oFils '-- enumerate files in the folder using For/Each. Each oFil is a File object.
filePath = oFil
myWord.Documents.Open filePath, True, True, False, , , False, , , 8, , True
myWord.PrintOut False
myWord.Documents.Close False
Next
myWord.Application.Quit False
Set myWord = Nothing
Set oFils = Nothing
Set oFol = Nothing
MsgBox "Complete!", vbOKOnly, "Printing done"
to use either of those scripts, copy & paste the code in to a blank text file and save it as whatever you want with the .vbs extension, then drag the folder containing your SIMS XML documents on to the script to run it on the files in that folder
I think this is the original reference: http://www.edugeek.net/forums/how-do...tml#post626095
I've posted a minor amendment to line 44 in that thread, in case anyone has issues with word asking for a conversion format after the script has been used.