Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread Keisuke Miyako via 4D_Tech
4D v18 is 750 MB. just over half of that size is taken by the embedded CEF web 
area. So it would be a shame not to use it at all other than for the welcome 
dialog.

my understanding is that the Chrome Embedded Framework is using the same PDF 
renderer as Chrome, that is, PDFium, a Google edition of the Foxit render.

https://opensource.google/projects/pdfium

https://www.foxitsoftware.com/blog/foxit-pdf-technology-chosen-for-google-open-source/

note that you can pass a posix path or a system path or an URL to the Web area. 

the difference between posix or system can be determined by the delimiter. but 
the difference between a path or an URL is less obvious, especially if you pass 
a file name. 

the reason you need to append the "file://" protocol, and to use an absolute 
path that begins with a forward slash (which results in a triple slash), is 
that as silly as it sounds, "test.pdf" by itself could be interpreted as an 
internet domain name and therefore ambiguous.

> On Apr 22, 2020, at 1:51, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have never used web areas in 4D so I will need to explore the benefits of 
> it. I notice it can also be used to display .png files and others dragged 
> into that ‘dropZone’ variable object on my form.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread Chris Belanger via 4D_Tech
SOLVED! Thanks Keith.
I should have noticed your post before I replied… Yay! This works!
Thank you so much. It is perfect!

For testing (and FYI to anyone else who wants to know):
Created a FORM: named  pdf_Viewer. Form.pdfURL [to store the path as 
per file:/// …]
Added:
• web area: named   web_pdfViewer
• variable: named dropZone expression type OBJECT   with  ‘droppable’ 
attribute;  ‘on drag over’ and ‘on drop’ as only events
 Then this code in the dropZone script:

C_LONGINT($0)
Case of 

: (Form event code=On Drag Over)
  // Accept On Drop event only if the pasteboard contains 
files, reject otherwise.
If (Get file from pasteboard(1)="")  //no file in pasteboard
$0:=-1  //reject drop
End if 

: (Form event code=On Drop)  //Requires Droppable action enabled from 
Property List
$dropName:=Get file from pasteboard(1)
If (Test path name($dropName)=Is a document)  // if it is a 
document...
$droppedFile:=File(Convert path system to 
POSIX($dropName))  // get the FILE
If ($droppedFile.isFile)  // is a file!
Form.pdfURL:="file:///"+$droppedFile.path
WA OPEN URL(*;"web_pdfViewer";Form.pdfURL)
End if 
End if 

End case 

And it displays the PDF in the webArea with ability to scroll through the whole 
document.

I have never used web areas in 4D so I will need to explore the benefits of it. 
I notice it can also be used to display .png files and others dragged into that 
‘dropZone’ variable object on my form.

— Chris


> On Apr 21, 2020, at 9:40 AM, kculotta via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> This worked after adding the third /  WA OPEN URL(*;"wa";"file:///Test.pdf")
> 
>> On Apr 21, 2020, at 10:36 AM, kculotta via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> No one mentioned WA OPEN URL and a web area, which I thought would have been 
>> as easy as WA OPEN URL(*;"wa";"Test.pdf"), but that only resulted in a blank 
>> area.
>> When I did get a pdf to open in the web area, all pages were available.
>> Is that different than what you are asking?
>> 
>> Keith - CDI
>> 
>>> On Apr 21, 2020, at 12:14 AM, Chris Belanger via 4D_Tech 
>>> <4d_tech@lists.4d.com> wrote:
>>> 
>>> Is there a way in 4D to display PDF documents? Either natively inside it 
>>> [with a plug-in, web thingy or otherwise] or by showing in a system pdf 
>>> viewer?
>>> **
>> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread Herr Alexander Heintz via 4D_Tech
Used it for ages.
On Mac no magic required, works out of the box, on Windows you might need to 
install Adobe Reader.
On newer windows systems (win 10) i thinks it works right out of the box, but 
would have to verify...

> Am 21.04.2020 um 18:36 schrieb Chris Belanger via 4D_Tech 
> <4d_tech@lists.4d.com>:
> 
> That sounds like something I would really like to work. If the web area knew 
> what pdf renderer to use, it sounds like theoretically that should do it. 
> Anyone know of how to get it to work?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread Chris Belanger via 4D_Tech
That sounds like something I would really like to work. If the web area knew 
what pdf renderer to use, it sounds like theoretically that should do it. 
Anyone know of how to get it to work?

— Chris


> On Apr 21, 2020, at 9:36 AM, kculotta via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> No one mentioned WA OPEN URL and a web area, which I thought would have been 
> as easy as WA OPEN URL(*;"wa";"Test.pdf"), but that only resulted in a blank 
> area.
> When I did get a pdf to open in the web area, all pages were available.
> Is that different than what you are asking?
> 
> Keith - CDI
> 
>> On Apr 21, 2020, at 12:14 AM, Chris Belanger via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Is there a way in 4D to display PDF documents? Either natively inside it 
>> [with a plug-in, web thingy or otherwise] or by showing in a system pdf 
>> viewer?
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread kculotta via 4D_Tech
This worked after adding the third /  WA OPEN URL(*;"wa";"file:///Test.pdf")

> On Apr 21, 2020, at 10:36 AM, kculotta via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> No one mentioned WA OPEN URL and a web area, which I thought would have been 
> as easy as WA OPEN URL(*;"wa";"Test.pdf"), but that only resulted in a blank 
> area.
> When I did get a pdf to open in the web area, all pages were available.
> Is that different than what you are asking?
> 
> Keith - CDI
> 
>> On Apr 21, 2020, at 12:14 AM, Chris Belanger via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Is there a way in 4D to display PDF documents? Either natively inside it 
>> [with a plug-in, web thingy or otherwise] or by showing in a system pdf 
>> viewer?
>> **
>  

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread kculotta via 4D_Tech
No one mentioned WA OPEN URL and a web area, which I thought would have been as 
easy as WA OPEN URL(*;"wa";"Test.pdf"), but that only resulted in a blank area.
When I did get a pdf to open in the web area, all pages were available.
Is that different than what you are asking?

Keith - CDI

> On Apr 21, 2020, at 12:14 AM, Chris Belanger via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Is there a way in 4D to display PDF documents? Either natively inside it 
> [with a plug-in, web thingy or otherwise] or by showing in a system pdf 
> viewer?
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-21 Thread UKVetDerm via 4D_Tech
http://www.pluggers.nl/product/pdf-viewer/ has served us well for a long time.

Steve

On 21/04/2020, 06:12, "4D_Tech on behalf of Chris Belanger via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

Is there a way in 4D to display PDF documents? Either natively inside it 
[with a plug-in, web thingy or otherwise] or by showing in a system pdf viewer?
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: With v18r2, can 4D display pdf documents?

2020-04-20 Thread Keisuke Miyako via 4D_Tech
with a plugin-in

http://www.pluggers.nl/product/pdf-viewer/

a web thingy

https://mozilla.github.io/pdf.js/

---

I would consider the two above to be your top choices.

I've posted a few convert-to-picture examples, 
but it sounds like you would want to render and display, not rasterise.

https://miyako.github.io/2020/04/19/4d-plugin-xpdf.html
https://miyako.github.io/2020/01/01/4d-plugin-pdfium.html

> On Apr 21, 2020, at 14:14, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is there a way in 4D to display PDF documents? Either natively inside it 
> [with a plug-in, web thingy or otherwise] or by showing in a system pdf 
> viewer?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**