I feel that there are some methods missing in the GlyphsCore.framework(oc+xcode) Compared with Python API

Make Plugin use OC and Xcode, At the GlyphsCore.framework whether there is a method like that in Python’s GSEditViewController.saveToPdf () ,?I haven’t found it.

Do you know the Script by Mekkablue, called “Method Reporter”?
You can type any of the existing objects, and it will spit out all methods and properties of it.

When I filter for “pdf” on GSEditViewController, it shows:

So it’s there, just double check the letter casing.

I know this. I’m using the OC frGlyphsCore.framework now, but I can’t find it in the “GSGlyphEditViewProtocol.h” 、“GSGlyphViewControllerProtocol.h” :sweat_smile:

I didn’t see that you talked about Objective-C (“oc”) wasn’t clear to me, sorry.

Yes, some things are not public, but if you know they exist, you can add an interface declaring the method to silence the compiler.

I’m very grateful that you can help me solve the problem. I didn’t describe it clearly. I revised the problem description after looking at your answer, but can you give me some advice on how to do it, or give me a simple example? I just started to learn how to use OC. There are a lot of things to learn.

The GSEditViewController is not part of GlyphsCore. It belongs to the app itself. The GSGlyphEditViewProtocol.h is there to export functionality if needed.

If you are trying to find functionality that is available in python, you can have a look at the python wrapper to see how it is actually implemented and what objectiveC API is used.

There you can see how the saveToPDF method works:

def GSEditViewController_saveToPDF(self, path, rect=None):
	if rect is None:
		rect = self.viewPort
	pdf = self.graphicView().dataWithPDFInsideRect_(rect)
	pdf.writeToFile_atomically_(path, True)

I’ve used the savetopdf () interface of Python. Now I want to switch to OC.I need this functionality in oc. or can I called the functionality from python api in OC?

The above code can be translated easily to objectiveC. So you can build your own saveToPDF function.

Ha,I see what you mean above yesterday. Language barrier is really a troublesome thing! :grinning: