allcolor / YaHP-Converter

YaHP is a Java library that allows you to convert an HTML document into a PDF document.
GNU Lesser General Public License v2.1
56 stars 23 forks source link

Disable certain features #7

Closed rnagpure372 closed 11 years ago

rnagpure372 commented 11 years ago

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

allcolor commented 11 years ago

Hi, just have a look at the YahpSample.java, it contains code showing how to do crypting, prevent screen reading/printing, etc.

Regards.

2013/5/22 rnagpure372 notifications@github.com

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/7 .

All those moments will be lost in time, like tears in rain.

rnagpure372 commented 11 years ago

Thank u for your reply where get YahpSample.java file

On Wed, May 22, 2013 at 6:28 PM, Quentin Anciaux notifications@github.comwrote:

Hi, just have a look at the YahpSample.java, it contains code showing how to do crypting, prevent screen reading/printing, etc.

Regards.

2013/5/22 rnagpure372 notifications@github.com

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7> .

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18276175 .

allcolor commented 11 years ago

Sorry it's CSimpleConversion.java, here:

https://github.com/allcolor/YaHP-Converter/tree/master/YaHPSample/src/org/allcolor/yahp/sample

It's in the distribution.

For example, to add a password, add this in the properties map:

properties.put(IHtmlToPdfTransformer.USE_PDF_ENCRYPTION, "true"); properties.put(IHtmlToPdfTransformer.PDF_ALLOW_SCREEN_READERS,"true"); properties.put(IHtmlToPdfTransformer.PDF_ENCRYPTION_PASSWORD,password);

To sign a PDF, add these:

properties.put(IHtmlToPdfTransformer.USE_PDF_SIGNING,"true"); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_FILE,keystorePath); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_KEYSTORE_PASSWORD,keystorePassword); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_PASSWORD,keyPassword); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_REASON,cryptReason); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_LOCATION,cryptLocation);

keystorePath == path to the keystore java which contains the key you want to use. keystorePassword == keystore password keyPassword == keystore key password for the key you want to use cryptReason == the reason to sign the document cryptLocation == the location where the document was signed

The following properties can be set (with true/false value):

PDF_ALLOW_ASSEMBLY PDF_ALLOW_COPY PDF_ALLOW_DEGRADED_PRINTING PDF_ALLOW_FILLIN PDF_ALLOW_MODIFT_ANNOTATIONS PDF_ALLOW_MODIFY_CONTENTS PDF_ALLOW_PRINTING PDF_ALLOW_SCREEN_READERS

Regards

2013/5/23 rnagpure372 notifications@github.com

Thank u for your reply where get YahpSample.java file

On Wed, May 22, 2013 at 6:28 PM, Quentin Anciaux notifications@github.comwrote:

Hi, just have a look at the YahpSample.java, it contains code showing how to do crypting, prevent screen reading/printing, etc.

Regards.

2013/5/22 rnagpure372 notifications@github.com

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7> .

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18276175>

.

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18324810 .

All those moments will be lost in time, like tears in rain.

rnagpure372 commented 11 years ago

I am not getting what means keyStorePath,cryptReason,cryptLocation

On Thu, May 23, 2013 at 12:08 PM, Quentin Anciaux notifications@github.comwrote:

Sorry it's CSimpleConversion.java, here:

https://github.com/allcolor/YaHP-Converter/tree/master/YaHPSample/src/org/allcolor/yahp/sample

It's in the distribution.

For example, to add a password, add this in the properties map:

properties.put(IHtmlToPdfTransformer.USE_PDF_ENCRYPTION, "true"); properties.put(IHtmlToPdfTransformer.PDF_ALLOW_SCREEN_READERS,"true"); properties.put(IHtmlToPdfTransformer.PDF_ENCRYPTION_PASSWORD,password);

To sign a PDF, add these:

properties.put(IHtmlToPdfTransformer.USE_PDF_SIGNING,"true"); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_FILE,keystorePath);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_KEYSTORE_PASSWORD,keystorePassword);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_PASSWORD,keyPassword);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_REASON,cryptReason); properties.put(IHtmlToPdfTransformer.PDF_SIGNING_LOCATION,cryptLocation);

keystorePath == path to the keystore java which contains the key you want to use. keystorePassword == keystore password keyPassword == keystore key password for the key you want to use cryptReason == the reason to sign the document cryptLocation == the location where the document was signed

The following properties can be set (with true/false value):

PDF_ALLOW_ASSEMBLY PDF_ALLOW_COPY PDF_ALLOW_DEGRADED_PRINTING PDF_ALLOW_FILLIN PDF_ALLOW_MODIFT_ANNOTATIONS PDF_ALLOW_MODIFY_CONTENTS PDF_ALLOW_PRINTING PDF_ALLOW_SCREEN_READERS

Regards

2013/5/23 rnagpure372 notifications@github.com

Thank u for your reply where get YahpSample.java file

On Wed, May 22, 2013 at 6:28 PM, Quentin Anciaux notifications@github.comwrote:

Hi, just have a look at the YahpSample.java, it contains code showing how to do crypting, prevent screen reading/printing, etc.

Regards.

2013/5/22 rnagpure372 notifications@github.com

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7> .

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHub<

https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18276175>

.

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18324810>

.

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18326107 .

allcolor commented 11 years ago

Keystorepath is the path to your keystore file http://en.wikipedia.org/wiki/Keystore .

cryptReason, cryptLocation are text describing the reason and location for signing the document.

2013/5/23 rnagpure372 notifications@github.com

I am not getting what means keyStorePath,cryptReason,cryptLocation

On Thu, May 23, 2013 at 12:08 PM, Quentin Anciaux notifications@github.comwrote:

Sorry it's CSimpleConversion.java, here:

https://github.com/allcolor/YaHP-Converter/tree/master/YaHPSample/src/org/allcolor/yahp/sample

It's in the distribution.

For example, to add a password, add this in the properties map:

properties.put(IHtmlToPdfTransformer.USE_PDF_ENCRYPTION, "true"); properties.put(IHtmlToPdfTransformer.PDF_ALLOW_SCREEN_READERS,"true"); properties.put(IHtmlToPdfTransformer.PDF_ENCRYPTION_PASSWORD,password);

To sign a PDF, add these:

properties.put(IHtmlToPdfTransformer.USE_PDF_SIGNING,"true");

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_FILE,keystorePath);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_KEYSTORE_PASSWORD,keystorePassword);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_PRIVATE_KEY_PASSWORD,keyPassword);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_REASON,cryptReason);

properties.put(IHtmlToPdfTransformer.PDF_SIGNING_LOCATION,cryptLocation);

keystorePath == path to the keystore java which contains the key you want to use. keystorePassword == keystore password keyPassword == keystore key password for the key you want to use cryptReason == the reason to sign the document cryptLocation == the location where the document was signed

The following properties can be set (with true/false value):

PDF_ALLOW_ASSEMBLY PDF_ALLOW_COPY PDF_ALLOW_DEGRADED_PRINTING PDF_ALLOW_FILLIN PDF_ALLOW_MODIFT_ANNOTATIONS PDF_ALLOW_MODIFY_CONTENTS PDF_ALLOW_PRINTING PDF_ALLOW_SCREEN_READERS

Regards

2013/5/23 rnagpure372 notifications@github.com

Thank u for your reply where get YahpSample.java file

On Wed, May 22, 2013 at 6:28 PM, Quentin Anciaux notifications@github.comwrote:

Hi, just have a look at the YahpSample.java, it contains code showing how to do crypting, prevent screen reading/printing, etc.

Regards.

2013/5/22 rnagpure372 notifications@github.com

I am using YaHPConverter tool to convert HTML file to pdf file and I want to restrict user for copy, edit, save as, export. Only user should print.

When the pdf is viewed it shows a small strip with the above mentioned options. How can I disable some of the options available on this strip?

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7> .

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHub<

https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18276175>

.

— Reply to this email directly or view it on GitHub<

https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18324810>

.

All those moments will be lost in time, like tears in rain.

— Reply to this email directly or view it on GitHub< https://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18326107>

.

— Reply to this email directly or view it on GitHubhttps://github.com/allcolor/YaHP-Converter/issues/7#issuecomment-18327159 .

All those moments will be lost in time, like tears in rain.