text:
Bloomberg Surveillance Podcast: Trade Negotiation and Tourism (transcript)
Tom Keene: Welcome to the Bloomberg Surveillance Podcast, I'm Tom Keene. Daily, we bring you insight from the best in economics, finance investment and international relations. Find Bloomberg Surveillance on Apple Podcast, Soundcloud, Bloomberg.com, and of course on The Bloomberg (Network).
Tom Keene: Let us migrate forward to trade, which is most important right now.
Jonathan Ferro: Let us do that right now with Deborah Lehr, Paulson Institute Vice Chairman. Deborah, great to have you with us on the program. High-level trade talks commencing in Washington D.C.--What is your base case this week?
Deborah Lehr: Well, it's a very positive sign that Vice Premier Liu He is here, and the chances I think are good that they'll get some kind of framework deal. Not the final deal, but at least enough to have it go to the two presidents to finalize.
Ferro: So, Deborah is that something a little bit more than talks about talks? What do you think the framework will actually look like?
Lehr: Well there are several components that need to be included in any kind of final deal. One, the president has made clear that he wants to see additional exports from the United States to China, so expect the Chinese to announce purchases of U.S. products. They've already announced some in the agricultural area, including commitments on soybeans. And then there needs to be market access for companies. It doesn't make sense at all when you've got the largest banks in the world in China, and you can't have 100% owned securities firm.
Keene: Where are we on the legal history of joint ventures? If we're going to do more with trade, there has to be combinations, joint ventures; can U.S. companies still go in and do JV's to get things done in China?
Lehr: Well, legally they're allowed, of course, to go in and do joint ventures. But I think what the U.S. government is pushing for is that the choice of a joint venture should be up to the company and based on commercial terms, not to be required by the Chinese government. Obviously, we understand if there are some sectors that are sensitive, but the fact [that] the Goldman Sachs or JP Morgan can't have 100% owned securities firm is just outrageous.
Ferro: Deborah, we are at a point where maybe China is beyond having the standard excuse they're an emerging markets whereby they need to do these kind of things. Deborah do you think we are past that point with China? Is China developed enough that they can no longer lean on that emerging market status as an excuse?
Lehr: I think in some sectors it might be an excuse. In those we need to see some sort of timetable for opening. But, certainly in some sectors, particularly in the financial and technology area there is no excuse at all.
Keene: Deborah Lehr with us, she is Vice Chairman of the Paulson Institute, and we have her on now to talk about some of the questions of antiquities. She is an expert on the world's antiquities; let's dovetail trade into that ultimate trade […] which is tourism. I can go back to 1974 and the magic of finding the Terracotta Army in China. Everyone goes there, everybody makes the trek, it's one of the few reasons to go inland in the Pacific rim for American tourists. Is tourism part of the trade debate, and where is that right now?
Lehr: That's an excellent question, it hasn't really been part of the debate, although it has been one of the U.S.'s great exports and certainly one of China's great exports. The number of Chinese tourists continue to grow significantly, and it's become a huge potential market for countries like France, which is the number one destination and even now growing for countries in the Middle East.
Keene: Well, I mean, Jon Ferro sees that when he's in Gucci on Fifth Avenue, I get that. But what about us over there, when Americans go over to China, has that diminished with all the uproar over the last couple years?
Lehr: It has, there's not the same number of American tourists travelling, even though there's a significant number. It has been dropping because there have been concerns, including travel warnings that have come out of the State Department recently.
Ferro: Well, let's talk about something that came out of the Department of Justice in the last couple of days. This following paragraph: "The alleged conduct occurred from the indictment in 2012 - 2014, and includes an internal Huawei announcement that the company was offering bonus to employees who succeeded in stealing confidential information from other companies". Ratcheting up the pressure on Huawei ahead of these trade talks, Deborah, how does this feature as these individuals sit down in Washington D.C. to try and come up with what you describe as a trade framework? Is Huawei the elephant in the room?
Lehr: I'm not sure if it's the elephant in the room but it's certainly like the Chinese government going after Microsoft, IBM, and Apple all at the same time. It's a national champion in terms of its a company that people are very proud of, and while Huawei has been under scrutiny for over 20 years, this is the first time they've gone after it in a significant way. And the Justice Department has decided to go after an individual, which has really gotten people's attention in China, versus just the company like they did with ZTE.
Keene: But from where you sit, to John's good question, the Chinese at these tables of trade can't ignore that, can they? Given the history and heritage of Ms. Meng (Wanzhou) with the Communist Party?
Lehr: No they can't ignore that, I mean it's a very significant issue, and as I've said it's gotten a lot of attention in China because they have gone after an individual versus the company. While they understand, maybe not completely, but just a little bit that our justice system works separately from the political system, the fact that the president did come out and say that it'd potentially be part of a trade deal, led many to believe that this is political.
Keene: This has been very helpful, Deborah Lehr, thank you. She's Vice Chairman of the Paulson Institute and greatly appreciate it. John I thought you phrased that question just perfectly, that if it was AT&T or Microsoft or Apple we'd be in an uproar.
Ferro: Let's be clear about something though. The Chinese have blocked many American companies from operating in China. It's not apples for apples, but let's not pretend we have unfettered access into Chinese markets, and that is why they're sitting around the table in Washington today, because the United States does not.
Keene: I would say on and off the record the thunderous consensus of every CEO I've ever talked to is JVs always disappoint in China.


You agree to purchase a service from a sales person (door to door, or in-store kiosk) – your signature is required to make this legally binding.
Your signature is required to accept an agreement before confidential data is presented to you.
These are just a few random scenarios, I'm sure there are many more. In this post, I will focus on 2 (yes, I said two) cross-platform solutions to handle this task – one built with Adobe Flex & AIR, and one built with HTML5 Canvas & PhoneGap.
Watch the video below to see this in action, then we'll dig into the code that makes it work.
The basic flow of the application is that you enter an email address, sign the interface, then click the green "check" button to submit to the signature to a ColdFusion server. The server then sends a multi-part email to the email address that you provided, containing text elements as well as the signature that was just captured.
Let's first examine the server component of the sample application. The server side is powered by ColdFusion. There's just a single CFC that is utilized by both the Flex/AIR and HTML/PhoneGap front-end applications. The CFC exposes a single service that accepts two parameters: the email address, and a base-64 encoded string of the captured image data.
Note: I used base-64 encoded image data so that it can be a single server component for both user interfaces. In Flex/AIR you can also serialize the data as a binary byte array, however binary serialization isn't quite as easy with HTML/JS… read on to learn more.
The main user interface for the Flex/AIR solution is a simple UI with some form elements. In that UI there is an instance of my SignatureCapture user interface component. This is a basic component that is built on top of UIComponent (the base class for all Flex visual components), which encapsulates all logic for capturing the user signature. The component captures input based on mouse events (single touch events are handled as mouse events in air). The mouse input is then used to manipulate the graphics content of the component using the drawing API. I like to think of the drawing API as a language around the childhood game "connect the dots". In this case, you are just drawing lines from one point to another.
When the form is submitted, the graphical content is converted to a base-64 encoded string using the Flex ImageSnapshot class/API, before passing it to the server.
You can check out a browser-based Flex version of this in action at http://tricedesigns.com/portfolio/sigCaptureFlex/ – Just enter a valid email address and use your mouse to sign within the signature area. When this is submitted, it will send an email to you containing the signature.
You can check out the SignatureCapture component code below, or check out the full project at https://github.com/triceam/Mobile-Signature-Capture/tree/master/flex%20client. This class will also work in desktop AIR or browser/based Flex applications. The main application workflow and UI is contained with Main.mxml.
When the form is submitted, the graphical content is converted to a base-64 encoded string using the Canvas's toDataURL() method. The toDataURL() method returns a base-64 encoded string value of the image content, prefixed with "data:image/png,". Since I'll be passing this back to the server, I don't need this prefix, so it is stripped, then sent to the server for content within the email.
You can check out a browser-based version of this using the HTML5 Canvas in action at http://tricedesigns.com/portfolio/sigCapture/ – Again, just enter a valid email address and use your mouse to sign within the signature area. When this is submitted, it will send an email to you containing the signature. However, this example requires that your browser supports the HTML5 Canvas tag.
You can check out the SignatureCapture code below, or check out the full project at https://github.com/triceam/Mobile-Signature-Capture/tree/master/html%20client. This class will also work in desktop browser applications that support the HTML5 canvas. I used Modernizr to determine whether touch events are supported within the client container (PhoneGap or desktop browser). The main application workflow is within application.js.
Although you method uses images, an application that captures signatures can, in theory, record the length, pressure and angle of every stroke. Having those data, it would be very trivial to make slight variations to those parameters and produce perfect forgeries that even experts would not be able to tell apart from the original. Due to this, I think that, at some point, hand signatures will no longer be used. In the mean time, storing that kind of information should probably follow stricter rules than the storage of passwords.
I'm currently using this technique to store the signature in base64 format in a local sqlite database until the program gets synced at which point the signature will get uploaded and saved as an image.
What I'd like to be able to do is to reload this base64 string back into the drawable surface (and continue drawing if they want) so that when they return to the signature screen they can see what they have already drawn. Is there any way of doing this?
Apologies I didn't mention that I am using the Flex/AIR solution. And I think the function you mentioned is for Phonegap?
I can't find any similar functions for AIR that let me pass an Image object back into the graphics object/draw surface.
but I'm not sure how to get from there back to the graphic/drawable surface.
And is there a way to get the height/width from the base64 text (as presumably that's something I'll need to feed back into it).
The bitmapData property is appearing as a null value, should this be getting populated as soon as I set the source of the image or is there a function I need to call?
I'd tried something very similar before but I came across that same issue before.
However even though the x, y, width and height are all correct nothing seems to happen after that section of code runs.
I love the signature area and think its looks great but dont use cf. Is there a simple way to utilize the default email browser on the device and possibly add this as an attachment or preferably fill this as the body of the email? Using the flex option btw.
You *might* be able to use a mailto link and pass parameters, but I really don't know if it will be supported… I'll have to play around with it later to test.
Finally found what I was doing wrong. I thought the x and y positions on the Rect were the global positions not relative. The two functions I added to the class are below for any others wanting to load the signature back in from a base 64 string.
Could this work on a server that is running CF 6? The CONTENT attribute for the CFPARAM tag is invalid. Can I upload the signature to the server as an image and make a link to it in the database?
My guess is that it should be possible, but I don't remember specifics for CF6 & CFMail. The CF6 docs are no longer available on adobe.com, so I really am not sure.
Hey I as well am interested in running this on flash builder 4.6 mobile app, but I dont have access to cf server my host does not provide it. Is it possible to send a request to a php file?
Yes, you can also do this with PHP. The data is serialized as a base-64 encoded text string, which will work with any backend technology.
Any detail you can provide on the type of device/platform, and whether you are using the Flex or AIR solution? Also, are you scaling the image at all? If you capture it really small and upscale, it will be very pixelated. If you capture it big and shrink it, it will stay crisp. I have already successfully used this approach for legally binding contracts in business applications.
Your toString method has been modified, i no longer split the string at the appearence of "," , it wasn't working with the split.
The above produces the image of the same size as the original albeit dotted….
I can't really tell from the code in the comments what the problem is. You should be able to use this without pixellation.
The base64 encoded string can be written directly into a database as-is. It is no different than a long text string.
You can create two Signature Capture instances. It might need a few changes, since I only tested with one instance, but the code should be portable enough as-is.
Any solution to fix this issue/optimize the java script call to make the signature looks real?
You may need to capture all input on the touch events, then use a deferred drawing implementation. By deferring the actual drawing, it reduces processor bandwidth, and could enable better event capture. I haven't tried this yet, but it could work. The underlying problem is that the HTML5 canvas is not hardware accelerated in the web view on most Android devices.
what could be reason for the above failures.
Since I don't have those devices, and they weren't available when I published that post, I really don't know. Do you have a more detailed error message from the browser? It's probably a small JS error based on different behavior of the browsers.
I am using it with HTML5 and phonegap.
It is working very well on index.html(home screen).
please tell me what I am doing wrong.
Hi Vipul, can you elaborate on your issue, or provide sample code? I'm not able to determine any issues from your question.
Must this app be used on a Cold Fusion server?
Which contains the email information, however I cannot get it to send email after signing.
Has anyone modified it to use PHP or ASPX page easily?
No, there is no dependency on ColdFusion. You can download the content and save using any application server technology.
Thank you soooooo much for this awesome article. One thing I want to share with people who download this solution is the order of the script files with using jQuery Mobile. Your application works great until you introduce jquery.mobile-1.2.0.min.js. I struggled with this for a couple of hours. The canvasContainer would resize automatically but the canvas would have a width of 100px. This would then stretch and your pen would not line up with your signature. The solution was to move your application.js file to be one of the very last scripts. Basically, the size was trying to be determined before the control was completely rendered. Moving the file to the end finally solved the problem.
When i'm trying to draw a signature by fingure in phone canvas it draws two lines side by side but resulted signature image has one line. But in emulation when i draw a signature by mouse one signature drawn as it should work. But why i got two line side by side on phone canvas when i draw signature?? please help me. My project is delayed for that issue.
I,m Using Phonegap, unable to change line width and color, i need increase the line width and change the color for signature in canvas.
i have test the "air" version and i like it. thanks so much for the explanation. further more i need some help from you.
* if i want to erase the false part of my signature how can i do that? (like an eraser function).
Using the phonegap version is it possible to test for an empty submission? I.e the canvas hasn't changed?
I really like this example, you should also do give SuperSignature a try.
It is a html5 signature pad that works on website and mobile browsers.
Andy, great example, but using coldfusion, other than as a mail object, have you done anything getting this to work on an ipod? I would need to store the image on the server, to be able to print on a separate document. Any thoughts on this would be great.


Another medium that you can consider for looking at checked examples is file sharing websites. You can download the projects that you want to take a peek at and all in the space of a few minutes.
Don't know where to locate these file sharing websites? Then you can head over to the search engines and type in a few related search terms. These will uncover more than a few places where you can being your search for the ideal places to look.