156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 11 of 20

Re: Copy .plt files to a plotter

04-09-2012 07:08 AM in reply to: GeeHaa

When I use the open IP address command it opens the right plotter. Ping also works. The telnet command is unrecognized. I tried the code from the link and I still get the 550 file not found error. It says its logged in and everything in the response section of the error status. According to the OCe users manual FTP should work.


Sub TEST()
        Dim clsRequest As System.Net.FtpWebRequest = _
        DirectCast(System.Net.WebRequest.Create("ftp://serv/oce tds750/X.plt"), System.Net.FtpWebRequest)
        clsRequest.Credentials = New System.Net.NetworkCredential("anonymous", "Password")
        clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile

        ' read in file...
        Dim bFile() As Byte = System.IO.File.ReadAllBytes("C:\Lisp\X.plt")

        ' upload file...
          Dim clsStream As System.IO.Stream = _
            clsStream.Write(bFile, 0, bFile.Length)
    End Sub




254 Posts
44 Kudos
Registered: ‎07-20-2011
Post 12 of 20

Re: Copy .plt files to a plotter

04-09-2012 07:37 AM in reply to: GeeHaa

Ok, it's a OCE 750, probably HPGL2  contents to upload.

This requires binary mode because of the non ASCII data.


That's why i mentioned copy /b 

see this VB .net 2 sample 



156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 13 of 20

Re: Copy .plt files to a plotter

04-09-2012 01:49 PM in reply to: GeeHaa

I sort of figured out half of it. On the Oce after logging in and typing binary you have to change directories to the jobs folder on the plotter server. Once I did this the Put "x.plt" command worked now I just have to figure out how to change to this directory  in .Net.


Thanks for all your help.

156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 14 of 20

Re: Copy .plt files to a plotter

04-10-2012 02:20 PM in reply to: GeeHaa

Here Is what I'm trying. It pops up a command window and it sits open for about 30 seconds as if it was logging in but it does not print and it doesn't throw an exception maybe one of you can see what is wrong.

Dim pr As Process
        Dim args As New ProcessStartInfo("cmd.exe")
        With args
            .RedirectStandardInput = True
            .RedirectStandardOutput = True
            .UseShellExecute = False
            .WindowStyle = ProcessWindowStyle.Normal
        End With
        pr = Process.Start(args)
        pr.StandardInput.WriteLine("echo on" & Convert.ToChar(13)) 'chr(13) Enter key.
        pr.StandardInput.WriteLine("CD C:\LISP" & Convert.ToChar(13)) 'chr(13) Enter key.
        pr.StandardInput.WriteLine("FTP" & Convert.ToChar(13))
        pr.StandardInput.WriteLine("OPEN" & Convert.ToChar(13))
        pr.StandardInput.WriteLine("anonymous" & Convert.ToChar(13))
        pr.StandardInput.WriteLine(Password  & Convert.ToChar(13))
        pr.StandardInput.WriteLine("binary" & Convert.ToChar(13))
        pr.StandardInput.WriteLine("cd jobs" & Convert.ToChar(13))
        pr.StandardInput.WriteLine("put " + Chr(34) + "x x.plt" + Chr(34) & Convert.ToChar(13))

If I try this manually it works fine. 

Again thanks very much for your help.

254 Posts
44 Kudos
Registered: ‎07-20-2011
Post 15 of 20

Re: Copy .plt files to a plotter

04-10-2012 11:30 PM in reply to: GeeHaa

Isn't writeline already terminating the input with CR+LF


The enter key is CR+LF, so maybe you have to terminate each line with chr(13)+chr(10)

You did not terminate BYE

156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 16 of 20

Re: Copy .plt files to a plotter

04-11-2012 10:55 AM in reply to: GeeHaa

Adding the Line Feed after enter works. The only problem is it leaves the Dos window open and does not send the plots until you click inside the window and hit enter. I tried sending an enter and Line feed after bye but it still stays open without sending the files.



Valued Mentor
388 Posts
30 Kudos
Registered: ‎03-31-2005
Post 17 of 20

Re: Copy .plt files to a plotter

04-12-2012 03:33 PM in reply to: fieldguy

I got the code to work for my hp laser.  GeeHaa's comment about the "jobs" folder on the printer got me thinking.


I used the same script as before but used "pwd" (print working directory).  The printer replied "/" is the current directory.  I added an extra slash to the URI in the code and it worked.


Test script from CMD:



<login> user

<pword> guest

pwd <enter>



<CommandMethod("ftp4")> _
    Public Shared Sub ftp4()
        Dim request As FtpWebRequest = _
            DirectCast(FtpWebRequest.Create("" & Path.GetFileName("c:\Temp\TEST.TXT")), FtpWebRequest)
        request.Method = WebRequestMethods.Ftp.UploadFile
        request.Credentials = New NetworkCredential("user", "guest")
        request.UsePassive = False
        request.UseBinary = True
        request.KeepAlive = False
        request.Proxy = Nothing
        'Load the file
        Dim stream As FileStream = File.OpenRead("c:\Temp\test.txt")
        Dim buffer As Byte() = New Byte(CInt(stream.Length - 1)) {}
        stream.Read(buffer, 0, buffer.Length)
        'Upload file
        Dim reqStream As Stream = request.GetRequestStream()
        reqStream.Write(buffer, 0, buffer.Length)
        MsgBox("Uploaded Successfully", MsgBoxStyle.Information)
    End Sub


The code above can be used to upload plt files to hp printers. 


254 Posts
44 Kudos
Registered: ‎07-20-2011
Post 18 of 20

Re: Copy .plt files to a plotter

04-13-2012 12:32 AM in reply to: GeeHaa

Unfortunately currently i cannot do tests on any OCE device, but did some tests earlier.

One of tests had to do with the OCE JobTicket, the header info in a OCE PRN file.

Have a look at the the OCE JobTicket 2.6 specifications. One of the setings is JobStore:

JobStore boxname <dbname>
This specifies the name of the Smart Inbox in which the job shall be stored.



BeginTicket 2.6
  username JohnSmith
  jobname "TestJob 1"
  jobStore boxname myqueue
  BeginBlock 1
    hpgl2 plottertype HP650C origin lowerright  sp_eof off merge off
    Segment 1
    emulation hpgl2

    includeBlock 1
      ESC%0BINBP5,1CO"Océ WPD - version 1.19 build"PS37200,11880IP0...

 This type of PRN files can be submited to the OCE printer either

- using a simple copy command:copy /b C:\temp\oce.prn LPT1

- using youre ftp way of printing probably without the need to change the directory



156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 19 of 20

Re: Copy .plt files to a plotter

04-13-2012 06:56 AM in reply to: GeeHaa
DirectCast(FtpWebRequest.Create("" & Path.GetFileName("c:\Temp\TEST.TXT")), 

 Thank You both so much. All I did was add Jobs  in the URI and it Worked!!!

156 Posts
1 Kudo
Registered: ‎04-14-2005
Post 20 of 20

Re: Copy .plt files to a plotter

04-13-2012 11:02 AM in reply to: GeeHaa

In order to send more than one file at a time (without logging in for each file) using this method do I need to use asynchronous operations?



Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!