Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
How To Active print setting in Local html File
How To Active print setting in Local html File
Hello, I Try to load a html with flash plugin , and here is a button to Call System printer setting , In IE, It Calls well(Of course , It will ask for script run permission )。but in CEF, When Click the button ,Nothing appened, I have Tried GlobalCEFApp.AddCustomCommandLine('--enable-local-file-accesses');
anythings should I go before call this?
anythings should I go before call this?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How To Active print setting in Local html File
Hi,
If you are loading a local html file with a file:/// URL, you will have some restrictions.
Chromium do that for safety reasons and that's why it's recommended to load local files in CEF with a custom resource handler.
Check the CustomResourceBrowser demo.
If you are loading a local html file with a file:/// URL, you will have some restrictions.
Chromium do that for safety reasons and that's why it's recommended to load local files in CEF with a custom resource handler.
Check the CustomResourceBrowser demo.
Re: How To Active print setting in Local html File
Thank you very much, I will try it, you are so nice man.





Re: How To Active print setting in Local html File
Hello,I have tried load it from Chromium_OnGetResourceHandler
if request.Url = 'http://printerpage/' then
begin
TempStream := TFileStream.Create(ExtractFilePath(Application.ExeName) +
'printerpagesetting.html',fmOpenRead);//which has a swf embedded in it
Result := TCustomResourceHandler.Create(browser, frame, '', request,
TStream(TempStream), CefGetMimeType('html'));
end
else if request.Url = 'http://printerpage/flashwithprintbutton.swf' then
Begin
TempStream := TFileStream.Create(ExtractFilePath(Application.ExeName) +
'flashwithprintbutton.swf',fmOpenRead);//press the button will show system printer setting well in ie(win10)
Result := TCustomResourceHandler.Create(browser, frame, '', request,
TStream(TempStream), CefGetMimeType('swf'));
end;
But the flash button still have (no right?) to show printer setting, what's wrong or any other solution
if request.Url = 'http://printerpage/' then
begin
TempStream := TFileStream.Create(ExtractFilePath(Application.ExeName) +
'printerpagesetting.html',fmOpenRead);//which has a swf embedded in it
Result := TCustomResourceHandler.Create(browser, frame, '', request,
TStream(TempStream), CefGetMimeType('html'));
end
else if request.Url = 'http://printerpage/flashwithprintbutton.swf' then
Begin
TempStream := TFileStream.Create(ExtractFilePath(Application.ExeName) +
'flashwithprintbutton.swf',fmOpenRead);//press the button will show system printer setting well in ie(win10)
Result := TCustomResourceHandler.Create(browser, frame, '', request,
TStream(TempStream), CefGetMimeType('swf'));
end;
But the flash button still have (no right?) to show printer setting, what's wrong or any other solution
Re: How To Active print setting in Local html File
More:If it not because of right problem? then how to call printer in flash with cef
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How To Active print setting in Local html File
I know nothing about Adobe Flash programming but If you can't find a way to make it work you can also try the other workarounds for this kind of issues :
- Use a custom scheme. You could use URLs that start with 'myprotocol://' instead of 'http://' and load your contents from disk. Take a look at the SchemeRegistrationBrowser demo for more info.
- Another suggested workaround is using DATA urls.
Re: How To Active print setting in Local html File
Sorry for this, I have to add some information:
I test it in Chrome,IE,and Firefox, they can load and run print setting using file://......html , so i think it no need to understand how flash program it.....
but it can't work well in Cef4delphi demo browser...
Why?
I'm sorrry, but could you give us some demo on printer call (beside the window.print() using js
)
thank you very much!

I test it in Chrome,IE,and Firefox, they can load and run print setting using file://......html , so i think it no need to understand how flash program it.....
but it can't work well in Cef4delphi demo browser...
Why?
I'm sorrry, but could you give us some demo on printer call (beside the window.print() using js




thank you very much!






You do not have the required permissions to view the files attached to this post.
Re: How To Active print setting in Local html File
testfile is what i tested ...
thank you again.
thank you again.
You do not have the required permissions to view the files attached to this post.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How To Active print setting in Local html File
I'll take a look this weekend but I can't promise anything because I know nothing about Flash programming...
Re: How To Active print setting in Local html File
No matter what result, thanks for your job



