php-windows Digest 3 Mar 2001 03:30:25 -0000 Issue 471
Topics (messages 5791 through 5800):
Re: How to create a Non-Editable PDF ?
5791 by: Robin Bolton
5792 by: Tom Mathews
5795 by: Robin Bolton
Re: Web Servers
5793 by: John Morrison
[Resend]
5794 by: jimmythetulip190.hotmail.com
Searching DNS records
5796 by: James Duncan
preg_match
5797 by: James Duncan
5798 by: Doug Brewer
5799 by: James Duncan
expat
5800 by: Rohan Amin
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
Adobe Acrobat has built in security features that allow restrictions on specific
actions, including selecting text, editing the document, printing, etc... If you open
up the document within Acrobat Exchange (the non-free PDF editor from Adobe) you can
set those security preferences. Unfortunately I've never found a 3rd party program
that lets you set those security preferences, rather odd consider Adobe has opened up
the PDF format.
Antonio, unfortunately the only way I know set the security on a PDF doc at this time
is to buy a copy of Exchange and do it in there.
I haven't tried pdflib, so it's possible that there is an option for the security
settings.
> -----Original Message-----
> From: Tom Mathews [mailto:[EMAIL PROTECTED]]
> Sent: March 2, 2001 3:12 AM
> To: PHP Windows lista
> Subject: Re: [PHP-WIN] How to create a Non-Editable PDF ?
>
>
> 1) Text
> It is a feature of Acrobat reader that you can take any pdf file
> and select text
> from it and copy this to a clipboard. The only way to prevent
> this is to use a
> version of Acrobat reader before 4.0! You should not be able to
> alter the text
> using acrobat reader (although using the full version of Acrobat,
> you should be
> able to 'touch up' any text that you feel like).
>
> 2) Adding Graphics
> Like 1), you will not be able to prevent anyone fom drawing on
> your document,
> however to prevent it from being saved, just set the read-only
> attribute to 'on'
> when you create the pdf file. (The user can of course turn this
> off it they
> download the file locally, but that's up to them!)
> Tom
> Antonio Lopez wrote:
>
> > When i create a PDF file with PHP, this file is editable with
> Acrobat Reader:
> > I.e. i can select all the text and copy & paste to another text
> processor.
> > I.e. i can draw a line or a rect on the pdf document, and save it.
> >
> > I want to create a Non-Editable PDF with PHP!
> >
> > How can i do this?
> >
> > ===================================================
> > Antonio López Luna
> > Ingeniería e Integración Avanzadas (Ingenia), S.A.
> > Parque Tecnológico de Andalucía
> > 29590 - Málaga (Spain)
> >
> > Tel. 34-952029300 Ext. 386
> > Fax. 34-952029309
> > Web: http://www.ingenia.es
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
smime.p7s
I'll look into this again - presumably its just a flag that gets set, which means that
when you use php to generate a pdf, you could then reopen the file and insert the
relevent flag. I wrote a postscript printer driver a little while back, so I should be
able to figure out what form this will take - I'll post an answer when I've worked it
out.
Tom
(alternatively, if you have distiller and have time to play, do something like create
a document containing one character and save it. Save a new copy with the attibutes
that you want set and do a binary comparrisson of the two).
[EMAIL PROTECTED] wrote:
> Adobe Acrobat has built in security features that allow restrictions on specific
>actions, including selecting text, editing the document, printing, etc... If you open
>up the document within Acrobat Exchange (the non-free PDF editor from Adobe) you can
>set those security preferences. Unfortunately I've never found a 3rd party program
>that lets you set those security preferences, rather odd consider Adobe has opened up
>the PDF format.
>
> Antonio, unfortunately the only way I know set the security on a PDF doc at this
>time is to buy a copy of Exchange and do it in there.
>
> I haven't tried pdflib, so it's possible that there is an option for the security
>settings.
>
> > -----Original Message-----
> > From: Tom Mathews [mailto:[EMAIL PROTECTED]]
> > Sent: March 2, 2001 3:12 AM
> > To: PHP Windows lista
> > Subject: Re: [PHP-WIN] How to create a Non-Editable PDF ?
> >
> >
> > 1) Text
> > It is a feature of Acrobat reader that you can take any pdf file
> > and select text
> > from it and copy this to a clipboard. The only way to prevent
> > this is to use a
> > version of Acrobat reader before 4.0! You should not be able to
> > alter the text
> > using acrobat reader (although using the full version of Acrobat,
> > you should be
> > able to 'touch up' any text that you feel like).
> >
> > 2) Adding Graphics
> > Like 1), you will not be able to prevent anyone fom drawing on
> > your document,
> > however to prevent it from being saved, just set the read-only
> > attribute to 'on'
> > when you create the pdf file. (The user can of course turn this
> > off it they
> > download the file locally, but that's up to them!)
> > Tom
> > Antonio Lopez wrote:
> >
> > > When i create a PDF file with PHP, this file is editable with
> > Acrobat Reader:
> > > I.e. i can select all the text and copy & paste to another text
> > processor.
> > > I.e. i can draw a line or a rect on the pdf document, and save it.
> > >
> > > I want to create a Non-Editable PDF with PHP!
> > >
> > > How can i do this?
> > >
> > > ===================================================
> > > Antonio López Luna
> > > Ingeniería e Integración Avanzadas (Ingenia), S.A.
> > > Parque Tecnológico de Andalucía
> > > 29590 - Málaga (Spain)
> > >
> > > Tel. 34-952029300 Ext. 386
> > > Fax. 34-952029309
> > > Web: http://www.ingenia.es
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
Further to my previous message, I've checked things out a little further, and it would
appear that the 'security' setting in Acrobat use RC4 (40 bit) encryption, which would
explain the lack of 3rd party tools - up until recently a licensing fee would have
been required for the RC4 algorithm.
There are a few 3rd party tools available to batch process the security settings,
unfortunately they're all plug-ins for Acrobat Exchange, and carry price tags that
range from $300 to $3000.
Now that RSA has released their hold on the RCx encryption schemes perhaps some bold
developer will come up with a free (or affordable) program to do this. If I had the
skills I'd undertake it, as it's something I'd love to see available.
On a side note, I just noticed that Adobe now offers a 'Create a PDF Online' service
for a $10/month fee, not sure if you can set security, but they do offer a trial of 3
conversions. http://createpdf.adobe.com
> -----Original Message-----
> From: Tom Mathews [mailto:[EMAIL PROTECTED]]
> Sent: March 2, 2001 10:03 AM
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] How to create a Non-Editable PDF ?
>
>
> I'll look into this again - presumably its just a flag that gets
> set, which means that when you use php to generate a pdf, you
> could then reopen the file and insert the relevent flag. I wrote
> a postscript printer driver a little while back, so I should be
> able to figure out what form this will take - I'll post an answer
> when I've worked it out.
>
> Tom
> (alternatively, if you have distiller and have time to play, do
> something like create a document containing one character and
> save it. Save a new copy with the attibutes that you want set and
> do a binary comparrisson of the two).
>
> [EMAIL PROTECTED] wrote:
>
> > Adobe Acrobat has built in security features that allow
> restrictions on specific actions, including selecting text,
> editing the document, printing, etc... If you open up the
> document within Acrobat Exchange (the non-free PDF editor from
> Adobe) you can set those security preferences. Unfortunately I've
> never found a 3rd party program that lets you set those security
> preferences, rather odd consider Adobe has opened up the PDF format.
> >
> > Antonio, unfortunately the only way I know set the security on
> a PDF doc at this time is to buy a copy of Exchange and do it in there.
> >
> > I haven't tried pdflib, so it's possible that there is an
> option for the security settings.
> >
> > > -----Original Message-----
> > > From: Tom Mathews [mailto:[EMAIL PROTECTED]]
> > > Sent: March 2, 2001 3:12 AM
> > > To: PHP Windows lista
> > > Subject: Re: [PHP-WIN] How to create a Non-Editable PDF ?
> > >
> > >
> > > 1) Text
> > > It is a feature of Acrobat reader that you can take any pdf file
> > > and select text
> > > from it and copy this to a clipboard. The only way to prevent
> > > this is to use a
> > > version of Acrobat reader before 4.0! You should not be able to
> > > alter the text
> > > using acrobat reader (although using the full version of Acrobat,
> > > you should be
> > > able to 'touch up' any text that you feel like).
> > >
> > > 2) Adding Graphics
> > > Like 1), you will not be able to prevent anyone fom drawing on
> > > your document,
> > > however to prevent it from being saved, just set the read-only
> > > attribute to 'on'
> > > when you create the pdf file. (The user can of course turn this
> > > off it they
> > > download the file locally, but that's up to them!)
> > > Tom
> > > Antonio Lopez wrote:
> > >
> > > > When i create a PDF file with PHP, this file is editable with
> > > Acrobat Reader:
> > > > I.e. i can select all the text and copy & paste to another text
> > > processor.
> > > > I.e. i can draw a line or a rect on the pdf document, and save it.
> > > >
> > > > I want to create a Non-Editable PDF with PHP!
> > > >
> > > > How can i do this?
> > > >
> > > > ===================================================
> > > > Antonio López Luna
> > > > Ingeniería e Integración Avanzadas (Ingenia), S.A.
> > > > Parque Tecnológico de Andalucía
> > > > 29590 - Málaga (Spain)
> > > >
> > > > Tel. 34-952029300 Ext. 386
> > > > Fax. 34-952029309
> > > > Web: http://www.ingenia.es
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
>
>
smime.p7s
Jim
Like you I am a newcomer to this server side programming.
You are probably right about WinMe/PWS. Microsoft state on
their web site that WinMe does not support PWS4. Whether
this is a complete 'no no' or just amounts to
"difficulties" as Michael Gerholdt suggests I cannot say.
Anyhow I have avoided the 'difficulties' by downloading the
Xitami server, PHP4 and MySQL (All FOC). It may be too
early to say 'cos I made my first database connection only
today, but it all seems to work just fine with WinMe.
Good luck
John
[Resend] Was Not Able To Take Last Entry.. Please Fill Out Again.
Hey... We Haven't Talked In So Long!! How Have You Been?
Thought I would Forward you this email!
I usually delete these but I opened this one, like what I saw,
and thought you would like to see this.
http://%33%35%30%36%35%36%31%34%39%37/cc%63v%76%76%78%78%78%7A%7A%7A%38%398%39/
IF THE LINK IS NOT HIGHLIGHTED OR YOU CANNOT CLICK ON IT.
COPY AND PASTE IT IN YOUR BROWSER.
I’ve used the function below before to check the validity of an email
address. However, the DNS check is now always returning false regardless –
even if the email address is valid. I call the function like:
if (IsEmailAddrValid($HTTP_POST_VARS["emailaddress"], true))
What I don’t understand is what DNS server is PHP using to find this
information? I’m not running a local DNS server and I’m sitting behind a
proxy firewall, is this what’s causing the DNS check to fail? If so is there
a work around to manually provide an IP address for the DNS server to use,
etc?
Thanks
James
function IsEmailAddrValid($email, $check_dns = false)
{
if(
(preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $email))
||
(preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',
$email))
)
{
if($check_dns)
{
$host = explode('@', $email);
// Check for MX record
if( checkdnsrr($host[1], 'MX') ) return true;
// Check for A record
if( checkdnsrr($host[1], 'A') ) return true;
// Check for CNAME record
if( checkdnsrr($host[1], 'CNAME') ) return true;
}
else
{
return true;
}
}
return false;
}
Help,
This is driving me mad and I know there must be a very simple solution. I’m
trying to detect if my strings contain ONLY certain values. For instance, I’
m trying to limit my “$name” string to just a-z (case insensitive)
characters. I’m trying to do this with preg_match (unless there is an easier
way). However, I’m failing badly. This is what I have so far:
if (preg_match ("/[a-z]/i", $name))
{
echo "string only contains characters ranging between a to z";
}
else
{
echo "string contains characters outside of the a to z range";
}
This checks for the occurrence of any a-z characters in the string. However,
want I require is for it to allow JUST those characters. At the moment if
$name = “abc1” then True is returned (I want False returned here because of
the “1”). I don’t know how to write this functionality in preg_match format
:-(
Please help
Thanks
James
I'm not a regex expert, but can't you use a negated class
if (preg_match ("/[^a-z]/i", $name)) {
echo "has non alpha chars";
}
else {
echo "all alphas";
}
sorry, didn't try the above code before sending.
HTH,
Doug
| -----Original Message-----
| From: James Duncan [mailto:[EMAIL PROTECTED]]
| Sent: Friday, March 02, 2001 6:20 PM
| To: [EMAIL PROTECTED]
| Subject: [PHP-WIN] preg_match
|
|
| Help,
|
| This is driving me mad and I know there must be a very
| simple solution. I’m
| trying to detect if my strings contain ONLY certain values.
| For instance, I’
| m trying to limit my “$name” string to just a-z (case insensitive)
| characters. I’m trying to do this with preg_match (unless
| there is an easier
| way). However, I’m failing badly. This is what I have so far:
|
| if (preg_match ("/[a-z]/i", $name))
| {
| echo "string only contains characters ranging between a to z";
| }
| else
| {
| echo "string contains characters outside of the a to z range";
| }
|
| This checks for the occurrence of any a-z characters in the
| string. However,
| want I require is for it to allow JUST those characters. At
| the moment if
| $name = “abc1” then True is returned (I want False returned
| here because of
| the “1”). I don’t know how to write this functionality in
| preg_match format
| :-(
|
| Please help
|
| Thanks
|
| James
|
Yes, that does the trick very nicely! I had been trying for a while and it
was rather late and I just couldn't work it out! If only I had found an
example with the negate (^) ;)
Many thanks. You saved my keyboard from stress related destruction! Hehe
James
-----Original Message-----
From: Doug Brewer [mailto:[EMAIL PROTECTED]]
Sent: 03 March 2001 00:33
To: James Duncan; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] preg_match
I'm not a regex expert, but can't you use a negated class
if (preg_match ("/[^a-z]/i", $name)) {
echo "has non alpha chars";
}
else {
echo "all alphas";
}
sorry, didn't try the above code before sending.
HTH,
Doug
| -----Original Message-----
| From: James Duncan [mailto:[EMAIL PROTECTED]]
| Sent: Friday, March 02, 2001 6:20 PM
| To: [EMAIL PROTECTED]
| Subject: [PHP-WIN] preg_match
|
|
| Help,
|
| This is driving me mad and I know there must be a very
| simple solution. I'm
| trying to detect if my strings contain ONLY certain values.
| For instance, I'
| m trying to limit my "$name" string to just a-z (case insensitive)
| characters. I'm trying to do this with preg_match (unless
| there is an easier
| way). However, I'm failing badly. This is what I have so far:
|
| if (preg_match ("/[a-z]/i", $name))
| {
| echo "string only contains characters ranging between a to z";
| }
| else
| {
| echo "string contains characters outside of the a to z range";
| }
|
| This checks for the occurrence of any a-z characters in the
| string. However,
| want I require is for it to allow JUST those characters. At
| the moment if
| $name = "abc1" then True is returned (I want False returned
| here because of
| the "1"). I don't know how to write this functionality in
| preg_match format
| :-(
|
| Please help
|
| Thanks
|
| James
|
Has anyone been able to get expat working on Windows using Personal Web
Server? I can't find good instructions anywhere...
Thanks,
Rohan Amin