Jump to content
How to Install Plugins ×

'Portable Document Format' FileType Plugin (.PDF)


midora

Recommended Posts

 

'Portable Document Format' FileType Plugin (.PDF)

Summary

Set of two FileType plugins which allow the digital image editor 'Paint.NET' to open and save PDFs (Portable Document format).

  • Open means to render the PDF via Ghostsctipt to bitmap layers in Paint.NET
  • Save means to embed the bitmap layers into a PDF container.

It is important to understand that you can not edit vector graphics embedded in PDFs inside of Paint.NET using these plugins to open and save PDFs. Paint.NET is a bitmap editor.

Author

Martin Osieka

Download

Find the latest version of the plugins here:

 

ImPDF.Open.FileType v1.1.zip

 

ImPDF.Save.FileType v1.4.zip

 

 

Installation

Follow the instructions carefully

 

Installation of ImPDF.Open.FileType

  • Install Ghostscript (64-bit or 32-bit). The plugin has been tested with Ghostscript 9.10.  If Paint.NET is running as an 64bit application then you have to install "Ghostscript for Windows (64 bit)" else the 32bit version.
  • The plugin identifies the installed ghostscript version via the registry.  Specific ghostscript version required... details here:
    https://forums.getpaint.net/topic/22863-portable-document-format-filetype-plugin-pdf/?do=findComment&comment=557183
  • If you are using the plugin w/o Ghostscript a messagebox will popup telling you that Ghostscript is required.
  • Copy the two files OptionBasedLibrary vX.X.dll/.dlc to the Paint.NET\FileTypes\ folder
  • Copy the two files 'ImPDF.Open.FileType.dll/dlc' to the Paint.NET\FileTypes\ folder
  • Remove old ImPDF version from Paint.NET\FileTypes\ folder. If you need the save functionality then update to ImPDF.Save.FileType.
  • Do not remove older versions of the OptionBasedLibrary if they are required from other plugins.

Installation of ImPDF.Save.FileType

  • Unzip "ImPDF.Save.FileType vX.X.zip" and copy the two files "ImPDF.Save.FileType.dll" and "ImPDF.Command.exe" into the "FileTypes" folder of your Paint.NET installation. A typical location is "C:\Program Files\Paint.NET\FileTypes".
  • WARNING: Don't forget to remove older version of the ImPDF plugin (ImPDF.FileType.dll)!

Compatibility

Paint.NET 3.5.11 and 4.x

Supported languages

The language used in the plugin depends on the language setting of Paint.NET and the support of this language by the plugin. The fallback is the first supported language of the plugin. Languages are defined in the .dlc files. ImPDF.Open.FileType supports the following languages in the moment:

  • English
  • Deutsch

ImPDF.Save.FileType supports the following languages in the moment:

  • English

Dialog options

ImPDF.Open.FileType

  • tbd

ImPDF.Save.FileType

There are many options which control the features supported by this application. The following section tries to describe the options and features together with their dependencies.

  1. Document Settings
    ImPDF.FileType.Document%20%28Flat%20Comp   ImPDF.FileType.Document%20%28Separated%2
    Set the general options of the PDF.
    • Content
      Defines how many pages will be generated in the PDF.
      • Flat (Composite Only): 1 page
      • Separated Layers: (number of layers) pages
      • Flat + Separated: 1 + (number of layers) pages
      The 'only visible' option (which is checked by default) controls if all or just the visible layers will be added. The order of converting the layers to pages is bottom to up.
    • Conformity
      • PDF Basic: Allows all supported features and minimizes the storage size.
      • PDF/A-1B: ISO standard for long-term archiving of documents
        Some organizations require that you are delivering PDFs in PDF/A format. This standard is more strict about the structure and elements of the PDF. The goal of the standard is to view the content of the PDF in the future on new devices as today on the current ones. To use this option you have to provide an RGB color profile (best would be the one of your display). See http://www.color.org for the idea of color profiles. By default the plugin looks for the profile "ImPDF.Default.icc" in the Filetypes folder of Paint.NET. So you may place a copy of a profile there using the default name. Hint: PDF/A does not allow encryption.
    • Encoding
      Defines the compression method used to compress the images in the PDF.
      • None: Uncompressed
      • Zip (lossless): Compressed
      • JPEG (... quality) Compressed with quality loss
  2. Info Settings
    ImPDF.FileType.Info%20Settings.jpg
    Allows to set some info in the PDF: title, author, subjects, keywords. The application sets the creator and producer entries of the pdf.
  3. Layout Settings
    These settings define the size of the generated pages and the size and position of the images on the pages. Remember a pdf is a vector file format which is able to embed pixel images. So if you are talking about the size of a pdf then you are talking about a real world size using a unit. The 'Final Size' depends on the layout settings.
    • Page Size set to '(Based on image)'
      ImPDF.FileType.Layout%20%28Based%20on%20
      The application calculates the page size from the pixel size of the image and the dpi value stored with the image. In Paint.NET you may set the dpi value in the 'Resize...' dialog. If the 'Borders' checkbox is checked then the size increase by the values for the top, left, right, and bottom border.
    • Page Size set to '(User-defined)'
      ImPDF.FileType.Layout%20%28User-defined%
      Set the W x H values to define the 'Final Size'. If the 'Borders' checkbox is checked then the size available for the image is the user-defined size minus the border values.Use the 'Image' position and the 'Scaling' option to place the image on the page.
    • Page Size set to a fixed format like 'A4' or 'Letter'
      ImPDF.FileType.Layout%20Letter%20Setting
      If you select a given format then the 'Final Size' depends on the format and the 'Orientation' option. If the 'Borders' checkbox is checked then the size available for the image is the format size minus the border values.Use the 'Image' position and the 'Scaling' option to place the image on the page.
  4. Viewer Settings
    The viewer settings are providing hints how a pdf viewer application should show the pdf to the user. The viewer may use the hints or ignore them.
    • Rotation
      This option tells the viewer to rotate all pages in the pdf by 0, 90, 180, or 270 degrees. In some cases it is better to keep landscope orientated pages in portrait mode and let the viewer do the rotation. This make printing more simple.
    • Open PDF in 'Window View'
      ImPDF.FileType.Viewer%20%28Open%20in%20W
      This is the default used by PDFs. The viewer application opens a window on the display and shows the PDF inside of this window. You may provide additional hints to the viewer. 'Don't set' in a popup or an indeterminate state of a checkbox means that you do not like to provide this hint to the viewer.
      • Panels
        Beside the PDF pages the viewer may view a panel showing additional info about the PDF. You may set this option to the following values: Don't set, No panels, Bookmarks panel, Pages panel, Layers panel.
      • Pages
        Here you can define how many pages are visible in the window at the same time and how these pages are presented: Don't set, Single page, Single page continous, Two-up, Two-up continous, Coverpage + Two-Up, Coverpage + Two-Up continous.
      • Zoom
        This setting describes the size of a page in the window: Don't set, Fit page, Fit page width, Fit page height, Fit visible, Fit visible width, Fit visible height, Actual size, Zoom to. Zoom to also uses the 'factor' option (a percentage value). If you do not select 'Don't set' the you should also provide a start page index.
      • Window flags
        • Fit: Adapts the window size to the page size
        • Center: Centers the window on the display
        • Show Title: Shows the Info.Title entry above in the window title
      • Hide flags
        • Menu: Hides the menubar of the viewer
        • Tools: Hides the toolbar of the viewer
        • Controls: Hides the controls of the viewer (you may not be able to scroll, ...)
    • Open PDF in 'Fullscreen View'
      ImPDF.FileType.Viewer%20%28Open%20in%20F
      Ask the viewer to open the pdf in fullscreen mode of the viewer. The viewer may ask the user if he accepts this. There are no additional options.
    • Open PDF as 'Presentation'
      ImPDF.FileType.Viewer%20%28Open%20as%20P
      A presentation is a kind of slide show. The viewer will show one page after the other in fullscreen mode. You are able to define transition effects between the pages and timings. Hint: Not all pdf viewers are supporting the presentation mode.
  5. Security Settings
    ImPDF.FileType.Security%20%28None%29%20S   ImPDF.FileType.Security%20%28High%29%20S
    Setting the 'Encryption' option to Low (40 bit) or High (128 bit) allows you to protect the content of the PDF. The owner password is needed if there is the need to modify the PDF later. If the user password is set then the viewer application will ask for this password to open and decrypt the PDF. The 'Allow' flags define what the user is allowed to do with the PDF.

Known issues

ImPDF.Save.FileType v1.1:

  • You have to set the user environment variable ImPDFArguments (v1.1 only)
  • the "Defaults" button may cover other dialog controls => resize the dialog a bit
    Rick will check if this is a plugin or an application issue.
  • Final Page Size' may show 'Unknown' => change any dialog setting forth and back
    This is because the dialog has no idea about the document size temporary.
  • "OK" button is not diabled if the set of settings are not in a good state Only the application is able to disable the "OK" button.
  • "Cancel" just cancels the operation but not any changed setting. I guess this an application issue.
  • The preview does not show a preview of the page or the degeneration caused by JPEG encoding. The application generates the preview using the standard load method of the filetype plugin. But this plugin does not provide load because it is not able to load all variants of PDFs (just the ones the plugin generates). Maybe the application could add an OnSavePreview method in the future.

Examples

None

History

History of ImPDF.Open.FileType

 

  • ImPDF.Open.FileType 1.0 (15.3.2014)
    - Removed one conflict with the PDF-Export pugin ImPDF.
    - Individual filter entry for each file extensions in OpenFileSelector dialog
    - Derived from the general ImPS.Open.FileType plugin.

History of ImPDF.Save.FileType

 

  • ImPDF.Save.FileType 1.4 (15.3.2014)
    - Renamed dll from ImPDF.FileType.dll to ImPDF.Save.FileType.dll
    - Changes to avoid conflicts with ImPDF.Open.FileType
  • ImPDF.FileType v1.3 (22.7.2012):
    - Added Content option which allows to store the composite (flat) image or the layers or both
    - Added Viewer settings for open pdf in window mode. This allows to define things like the visible panel, the layout of the pages in the window, the view size of the image, the zoom value, the start page and more
    - Added Viewer setting to open pdf in presentation mode (slide show). Here you can define transition effects, transition time, view duration, looping, and background color. This feature embeds JavaScript into the pdf. So be prepared to check your viewer settings.
    - Added Security Settings: This allows you to encrypt the PDF using 40bit and 128bit password protection. You may define a password required to open the pdf and restrict the access to the pdf. Encryption is not possible if you like create PDF/A documents
  • ImPDF.FileType v1.2:
    - Added conformance to PDF/A-1B ISO standard for long-term archiving of documents. Select this feature via the "Conformity" combo box in the "Save configuration" dialog. In additon you have to select an RGB color profile (best would be the one of your display). See www.color.org for the idea of color profiles. By default the plugin looks for the profile "ImPDF.Default.icc" in the Filetypes folder of Paint.NET. So you may place a copy of a profile there.
  • ImPDF.FileType v1.1:
    - Adds some layout and viewer options.
    - Select the page size from some presets or choose a user-defined size or the image size.
    - Borders may be added to restrict the part of the page used for displaying the image.
    - The image can be scaled and positioned relative to the page.
    - Viewer options allow you to view the page rotated or in full screen view at the time when you are opening the PDF.
  • v1.0: The first version is quite simple. It just allows to create a one page PDF in the size of the original image showing the composite image. The encoding and some PDF description entries can be set. Future version may generate layered PDFs.
Edited by midora
  • Upvote 1

midoras signature.gif

Link to comment
Share on other sites

Excellent! I needed this for a long time, I just didn't know I did. I was doing all the work the hard way, copying and pasting into MS Word and then converting to PDF. Thank you very much!

If you'd consider suggestions for future development of the plugin, my wishlist includes the options to:

- Set the page size and margins (in centimetres and in inches). Offer different standard sizes as preset (e.g. A4, Letter, Legal etc)

- Limit the image size within the page and margins

- Position the image within the page (centre, top, bottom, left, right)

- Use other image file or document template or pdf or doc as background (very useful for stationery, lettereads, watermarks)

Xkds4Lh.png

Link to comment
Share on other sites

This will improve the workflow! Thanks Martin, an excellent plugin diagona.032.png

Link to comment
Share on other sites

Thanks for the positive feedback. Always good to read that software made for the community may be useful.

>>- Set the page size and margins (in centimetres and in inches). Offer different standard sizes as preset (e.g. A4, Letter, Legal etc)

>>- Limit the image size within the page and margins

>>- Position the image within the page (centre, top, bottom, left, right)

This is on the list, there is only the UI part missing.

>>- Use other image file or document template or pdf or doc as background (very useful for stationery, lettereads, watermarks)

The problem there is the user interface. I'm using xml templates to describe PDFs but you have to edit these xml files with a text or xml editor

I guess the only ui element (inside of Paint.NET) may be a selector for one of these templates.

midoras signature.gif

Link to comment
Share on other sites

If it's flattening the image, then it had better ask you to flatten. Otherwise I can't allow a plugin with a known data loss issue to be available on the forum.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Rick, it does ask/warn that the user is about to flatten the image.

Martin, thank you for your reply and the information. That's excellent news. I'm waiting patiently for the next version.

On the background matter, a simple selector to choose a document will be just fine, if at all possible.

And one more request, if I may:

Since we cannot fiddle with the security settings at our end, it would be very useful if the default restrictions set Document Assembly to "Allowed".

Xkds4Lh.png

Link to comment
Share on other sites

Rick, it does ask/warn that the user is about to flatten the image.

I guess this was a more general remark to "Just one thing I like about PDF Print, it doesn't ask to flatten".

I'm just not sure about a future version which will generate layered PDFs. Because for this the plugin needs the layer bitmaps and not the composite image.

And one more request, if I may:

Since we cannot fiddle with the security settings at our end, it would be very useful if the default restrictions set Document Assembly to "Allowed".

This is only possible if the PDF is encrypted. Because w/o encryption the PDF specification tells the PDF viewers to disallow assembly. For encryption you have to provide an owner password. I implemented 128-bit encryption in ImPDF.Command.exe but there is no ui in the moment.

midoras signature.gif

Link to comment
Share on other sites

You guys misunderstood me, I am not talking about exporting the layers individually , but exporting the file as "PrintScreen" directly in actual size from PDN, anyways it is hard to explain, so much discussion have already been made about this subject.

But I already found the solution, by using a one great screenshot application, and it gives me an almost lossless PNG "of course with no transparent pixs", at least is acceptable for me, but only problem I have is with the large canvas, because when view it in 100% "actual size" it won't fit in my screen.

Hoping one day we will have something like "Take a SnapShot" feature for the actual size.

Edited by yellowman
Link to comment
Share on other sites

@Martin: Have you given any thought to 'approximating' CYMK PDFs? http://cmyk-pdf.com/

I'm always looking for ways to get images to a printer in a useable format. CYMK PDF seems to be one that would be acceptable to most of the printers I submit to.

(Forgive me if this already implimented - I'm not at my home PC at the moment.)

Link to comment
Share on other sites

@Martin: Have you given any thought to 'approximating' CYMK PDFs? http://cmyk-pdf.com/

I'm always looking for ways to get images to a printer in a useable format. CYMK PDF seems to be one that would be acceptable to most of the printers I submit to.

Color management is always an issue if you are working with images. But I guess you know there is no simple conversion between RGB and CMYK.

At the end what you need to work on a professional level is a PDF which conforms to the PDF/X-1 ISO standard.

In the moment I'm on the road to implement PDF/A-1b. This is already a big step in the right direction. Because this is the standard for long-term archiving of documents and forces you to embed an output intend which maps DeviceRGB to a device independent color space.

What you also have to know is that if you are working on the ISO standard level you have to pay for specifications and licenses.

Everything would be easier if Paint.NET would support color management. But I understand why there is just a little chance that this will happen.

midoras signature.gif

Link to comment
Share on other sites

So very pleased you're still developing this plugin!

I'm fully aware of the problems converting RGB to CYMK, which is why I used the term 'approximating' boltbait.big_smile.png .

Thanks for the informative reply.

Link to comment
Share on other sites

Please set the environment variable "ImPDFArguments" to something like "Test" and restart Paint.NET.

I guess I missed to catch an exception.

midoras signature.gif

Link to comment
Share on other sites

@ Martin

Please set the environment variable "ImPDFArguments" to something like "Test" [unquote] How do I do that please.

Sorry. On Win7. Open the control panel from the Start menu of Windows.

Enter "Environment" into the Search control on the top.

Select: Edit environment variables for your account.

Select: New user variable

Enter for the variable name: ImPDFArguments

Enter for the variable value: Test

Close the dialog

Restart Paint.NET

midoras signature.gif

Link to comment
Share on other sites

Update v1.2: Added conformance to PDF/A-1B ISO standard for long-term archiving of documents.

See first message of the thread.

midoras signature.gif

Link to comment
Share on other sites

Excellent, thank you! It looks like a major upgrade from v1.0. I've tried it and it works like a charm. It does everything I need except allow assembly but I understand the limitations and I can live with that. All in all, a very useful plugin.

One imporvement in the "Save Confoguration" dialogue box, could be a clearer indication on what the units in the "Border" fields stand for. I understand that they depend on the units (cm or in) as set by the user for "Final Size" but others may not.

And, of course, the units for "Final Size" width and height cannot be "square" but good ol' plain "cm" and "in".

Xkds4Lh.png

Link to comment
Share on other sites

One imporvement in the "Save Confoguration" dialogue box, could be a clearer indication on what the units in the "Border" fields stand for. I understand that they depend on the units (cm or in) as set by the user for "Final Size" but others may not.

The space in the dialog is limited. Maybe I can improve this.

And, of course, the units for "Final Size" width and height cannot be "square" but good ol' plain "cm" and "in".

"Page Size" and "Final Size" are areas. Means in x in = sqin. At least in good old Switzerland ;-)

midoras signature.gif

Link to comment
Share on other sites

Martin, this "square" thingy is really very insignificant and has no implication whatsoever on the quality and/or functionality of your excellent plugin. I'm thankful for the plugin and for the time and effort you put into it. So perhaps I shouldn't have metnioned it, but...

I admit that Swiss people are somewhat unique (for lack of a better word) in their ways and that I've not been to "good old Switzerland" for almost three years now. However, I'm quite sure math is still math over there or I'd have heard about it. Trust me on this one.

Yes, the unit of measure for an area should be something squared. "in X in" does indeed produce square inches. But the numbers in your numbers boxes are NOT square inches, just good old plain inches. The units in the number boxes in the dialogue box are units for width and height, units of length.

The standard A4 page size in centimetres is 21cm for width and 29.7cm for height. If you insist in using square units then you should only have one number box and it should show "623.7" for sq. cm (or "96.68" for sq. in), that is the product of the two numbers that currently show.

I hope this makes sense in good old Switzerland and I hope I can visit again soon, hopefully in 2012.

Edited by Djisves

Xkds4Lh.png

Link to comment
Share on other sites

Martin, this "square" thingy is really very insignificant and has no implication whatsoever on the quality and/or functionality of your excellent plugin. I'm thankful for the plugin and for the time and effort you put into it. So perhaps I shouldn't have metnioned it, but...

Everything can be improved and sometimes there are errors or mistakes. So please tell if you think something is wrong. I'm thankful for this.

but... ;-)

2cm x 3cm = 6sqcm = 2sqcm * 3 = 2 * 3sqcm

Maybe it is unusual for you to write it in this way but from the point of math it is not correct to say 6sqcm = 2 * 3cm.

If your are talking with someone, aren't you saying: "This area has a size of 2 times 3 sqcm"?

midoras signature.gif

Link to comment
Share on other sites

Yes, the math is correct. Wonderful thing this mathematics science, very exact and to the point. But I'd never call the photograph of my children on my desk as "6 by 4 square inches photo" simply because the significant units are width (6 inches) and height (4 inches), not the area. Does anyone really care about the area of a photo or a page in square inches or centimetres? I did the caclulation for the first time in my life just to write my previous post.

Hence, the numbers boxes in the Save dialogue box should not indicate area. The numbers should specify the width and height of the page in cm or inches. That's the whole point of standard sized pages, not the area.

Xkds4Lh.png

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...

There is an update available to the PDF plugin: ImPDF.FileType v1.3. See the first post.

New features: Multipage mode, Open in Window hints, Open as presentation (slide show of pages) allowing to define transition effects and timing. Security options, password protection.

midoras signature.gif

Link to comment
Share on other sites

Excellent!

Thank you Martin for the plugin and thank you midora for letting us know.

I'll play with this one over the next few days.

Xkds4Lh.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...