Xojo Conferences
XDCMay2019MiamiUSA

[MBS] EPS Export fails with error, Mac. (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Different icon sizes using NSWorkspaceMBS.iconForfileType
Next thread: [MBS] Problem with openasjpegmbs


Re: [MBS] AuthorizationMBS   -   Garth Hjelte
  [MBS] EPS Export fails with error, Mac.   -   Obleo Beck
   Re: [MBS] EPS Export fails with error, Mac.   -   Christian Schmitz
    Re: [MBS] EPS Export fails with error, Mac.   -   Obleo Beck
   Re: [MBS] EPS Export fails with error, Mac.   -   Obleo Beck
   Re: [MBS] EPS Export fails with error, Mac.   -   Christian Schmitz
   Re: [MBS] EPS Export fails with error, Mac.   -   Obleo Beck
   Re: [MBS] EPS Export fails with error, Mac.   -   Christian Schmitz
   Re: [MBS] EPS Export fails with error, Mac.   -   Obleo Beck
   Re: [MBS] EPS Export fails with error, Mac.   -   Christian Schmitz

[MBS] EPS Export fails with error, Mac.
Date: 16.04.15 19:00 (Thu, 16 Apr 2015 13:00:32 -0500)
From: Obleo Beck
Hello Christian,

EPS Export fails with error. I got this to work with MBSComplete v14.1 but it now fails with versions 14.4 and later I tried MBS Complete v15.0 + also.

This is the one I want to use (and it worked in the past);

HTMLViewer.RenderDocumentToEPSMBS as Memoryblock

dim f as FolderItem
dim b as BinaryStream

f=SpecialFolder.Desktop.Child("test.eps")
bðCreateBinaryFile("")
b.Write theHTMLViewer.RenderDocumentToEPSMBS
b.Close

-----------------------------------------------------------------------------

While trying to figure out why this was not working. I also tried several other EPS releaed syntax and all of those failed with the same error.

These are the others I tied;

1.) HTMLViewer.RenderEPSMBS as Memoryblock

2.) NSPrintOperationMBS.EPSOperationWithView(view as NSViewMBS, rect as NSRectMBS, printInfo as NSPrintInfoMBS, file as folderitem) as NSPrintOperationMBS

3.) NSViewMBS.dataWithEPSInsideRect(left as double, top as double, width as double, height as double) as Memoryblock

I not sure what to do to get this working again, or the reason while it may not be working. Is it a bug in the Plug-in or something Apple Removed for Mac OS 10.10.2 ? I not sure, however I been trying to figure this out for day on my side and can not figure out why it seems to now fail after all these years of working with past versions.

Xojo v 2015r1
MBS Complete 14.4 (I also tried 15.0.x)
OS Mac OS 10.10.2

I could forward a source code file if that helps.

Thanks for any help.

Regards,

Obleo A Beck
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] EPS Export fails with error, Mac.
Date: 17.04.15 21:14 (Fri, 17 Apr 2015 22:14:05 +0200)
From: Christian Schmitz

> The webView not nil, b is not nil. What more odd if I take the same code I had. Then change this one line b.Write wvVectorView1.RenderDocumentToEPSMBS to b.Write wvVectorView1.RenderDocumentToPDFMBS it will save the view to a PDF without issue. It only fails at EPS.

please check the memoryblock:

dim m as memoryblock = wvVectorView1.RenderDocumentToEPSMBS
dim s as string = m
b.Write s

so it may raise exception in the middle line.

Sincerely
Christian

Re: [MBS] EPS Export fails with error, Mac.
Date: 17.04.15 21:24 (Fri, 17 Apr 2015 15:24:51 -0500)
From: Obleo Beck

> On Apr 17, 2015, at 3:14 PM, Christian Schmitz <<email address removed>> wrote:
>
> dim m as memoryblock = wvVectorView1.RenderDocumentToEPSMBS
> dim s as string = m
> b.Write s


Ok I ran that and here the results;

I got a NilObjectException when I ran that code.

m = Nil

the html doc loaded in the html view just fine, so the view is working. Not sure why it thinks its nil, unless its the EPS data? hum...

Regards,

Obleo A. Beck
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] EPS Export fails with error, Mac.
Date: 17.04.15 19:47 (Fri, 17 Apr 2015 13:47:31 -0500)
From: Obleo Beck

> On Apr 17, 2015, at 10:51 AM, Christian Schmitz <<email address removed>> wrote:
>
>
>> As soon as It tries to save the eps file the NilObjectException highlights this line —> b.Write webView.RenderDocumentToEPSMBS
>
> you should split the line.
>
> is webview nil?
> Does it return a nil memoryblock?
> is b nil?
>
> because converting empty memoryblock to string would give an error.

The webView not nil, b is not nil. What more odd if I take the same code I had. Then change this one line b.Write wvVectorView1.RenderDocumentToEPSMBS to b.Write wvVectorView1.RenderDocumentToPDFMBS it will save the view to a PDF without issue. It only fails at EPS.

I tried to look at Apple Developer Connect for info about EPS related items for tips or to see if anything been deprecated recently ( since apple added swift to objective-c last summer a ton of items have been deprecated since 10.10, not sure if this was also?) However, I had a hard time finding anything on EPS in apple docs for Mac OS. The only items I found where NSPrintOperation and NSEPSImageRep (I not sure if these are what being used here when calling wvVectorView1.RenderDocumentToEPSMBS )

I might just go with the htmlview.RenderDocumentToPDFMBS and use PDF over EPS, It should basically support the same thing and it is working great with xojo, your plugins and mac.

Regards,

Obleo A. Beck

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] EPS Export fails with error, Mac.
Date: 17.04.15 16:51 (Fri, 17 Apr 2015 17:51:47 +0200)
From: Christian Schmitz

> As soon as It tries to save the eps file the NilObjectException highlights this line —> b.Write webView.RenderDocumentToEPSMBS

you should split the line.

is webview nil?
Does it return a nil memoryblock?
is b nil?

because converting empty memoryblock to string would give an error.

Sincerely
Christian

Re: [MBS] EPS Export fails with error, Mac.
Date: 16.04.15 22:17 (Thu, 16 Apr 2015 16:17:32 -0500)
From: Obleo Beck

> On Apr 16, 2015, at 4:03 PM, Christian Schmitz <<email address removed>> wrote:
>
>
>>
>> That odd because I get RenderDcoumentToPDFMBS to work like a charm on my end, only the RenderDcoumentToEPSMBS throws a NilObjectException
>>>
>
> NilObjectException?
> Where? Does it have a message?

When I run the code; (I snip the whole eps segment, webView = a HTMLViewer)

dim b as BinaryStream
dim f as folderitem
dim dlg as new SaveAsDialog

dlg.InitialDirectory=SpecialFolder.Pictures
dlg.SuggestedFileName="Untitled"
dlg.Title="Export"
dlg.Filter=epsType
f=dlg.ShowModalWithin(winMain)

if f <> Nil then

b=f.CreateBinaryFile("")
b.Write webView.RenderDocumentToEPSMBS
b.close

end if

As soon as It tries to save the eps file the NilObjectException highlights this line —> b.Write webView.RenderDocumentToEPSMBS

———

Regards,

Obleo A. Beck
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] EPS Export fails with error, Mac.
Date: 16.04.15 22:03 (Thu, 16 Apr 2015 23:03:30 +0200)
From: Christian Schmitz

>
> That odd because I get RenderDcoumentToPDFMBS to work like a charm on my end, only the RenderDcoumentToEPSMBS throws a NilObjectException
>>

NilObjectException?
Where? Does it have a message?

>
> How do I do that, never reported a bug to Apple before.

http://bugreport.apple.com

Sincerely
Christian

Re: [MBS] EPS Export fails with error, Mac.
Date: 16.04.15 21:53 (Thu, 16 Apr 2015 15:53:26 -0500)
From: Obleo Beck


> On Apr 16, 2015, at 3:42 PM, Christian Schmitz <<email address removed>> wrote:
>
>> HTMLViewer.RenderDocumentToEPSMBS as Memoryblock
>
> This works for me and make an EPS file. Converting to PDF fails.

That odd because I get RenderDcoumentToPDFMBS to work like a charm on my end, only the RenderDcoumentToEPSMBS throws a NilObjectException

>
>>
>> I not sure what to do to get this working again, or the reason while it may not be working. Is it a bug in the Plug-in or something Apple Removed for Mac OS 10.10.2 ? I not sure, however I been trying to figure this out for day on my side and can not figure out why it seems to now fail after all these years of working with past versions.
>
> Looks like Apple broke it. Maybe you can report to Apple via bugreporter?
> I bet they have an EPS expert who could take a look and see what's broken in the file.

How do I do that, never reported a bug to Apple before.

>
> Sincerely
> Christian
>
> --
> Read our blog about news on our plugins:
>
> http://www.mbsplugins.de/
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> <email address removed>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Thanks for taking a look.

Regards,

Obleo A. Beck

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] EPS Export fails with error, Mac.
Date: 16.04.15 21:42 (Thu, 16 Apr 2015 22:42:35 +0200)
From: Christian Schmitz

> HTMLViewer.RenderDocumentToEPSMBS as Memoryblock

This works for me and make an EPS file. Converting to PDF fails.

>
> I not sure what to do to get this working again, or the reason while it may not be working. Is it a bug in the Plug-in or something Apple Removed for Mac OS 10.10.2 ? I not sure, however I been trying to figure this out for day on my side and can not figure out why it seems to now fail after all these years of working with past versions.

Looks like Apple broke it. Maybe you can report to Apple via bugreporter?
I bet they have an EPS expert who could take a look and see what's broken in the file.

Sincerely
Christian