Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to PDF should support transparent background #2093

Closed
aparamon opened this issue Mar 27, 2019 · 6 comments
Closed

Export to PDF should support transparent background #2093

aparamon opened this issue Mar 27, 2019 · 6 comments
Assignees
Labels
PDF Preview Wishlist New features (not a bug)
Milestone

Comments

@aparamon
Copy link

Current Behavior

Preview export to PDF always saves background rect.

Expected Behavior

There should be an option to have transparent background, like when exporting PNG.

Your Environment

  • Product Version: Gephi 0.9.2 201709241107
  • Java: 1.8.0_201; Java HotSpot(TM) 64-Bit Server VM 25.201-b09
  • Runtime: Java(TM) SE Runtime Environment 1.8.0_201-b09
  • System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (gephi)
  • User directory: C:\Users\paramon\AppData\Roaming.gephi\0.9.2\dev
  • Cache directory: C:\Users\paramon\AppData\Roaming.gephi\0.9.2\dev\var\cache
@mbastian mbastian added this to the 0.9.3 milestone Oct 24, 2021
@mbastian mbastian added PDF Wishlist New features (not a bug) labels Oct 24, 2021
@mbastian mbastian modified the milestones: 0.9.3, 0.9.4 Mar 1, 2022
@mbastian mbastian modified the milestones: 0.9.4, 0.10.0 Apr 11, 2022
@mbastian
Copy link
Member

Makes sense, let me summarise.

Definition of done

  • Add option to PDF configuration panel for transparent background. Makes sure this configuration is also saved in preferences like the others.
  • Modify PDF export accordingly

@Meta-Ace Meta-Ace self-assigned this Aug 31, 2022
@Meta-Ace
Copy link
Contributor

Meta-Ace commented Sep 1, 2022

To my understanding and through trial and error this feature does not seem possible! I have exported images from other programs with a "transparent" background, and when the PDF is opened, they white rectangle is drawn in. Changing the alpha to 0 and making the canvas transparent both still resulted in the white rectangle being drawn. I believe this is due to the fact that PDF requires there to be a canvas, as opposed to PNG which acts as a bitmap. This is my current understanding, if you know otherwise please feel free to reach out

@mbastian
Copy link
Member

mbastian commented Sep 3, 2022

Thanks @Meta-Ace. How did you actually check whether the PDF has transparent background? In which program? Based on my own research it does seem that PDFs can have transparent backgrounds.

@Meta-Ace
Copy link
Contributor

Meta-Ace commented Sep 4, 2022

Come had a program that already supported exporting transparent backgrounds, I don't know which exactly and we selected transparent background for PDF and when we opened it it was a white background. I would have to ask him which program it was.

@mbastian
Copy link
Member

mbastian commented Sep 5, 2022

Hi again, I did a bit more research and was able to create PDF with transparent background. I think you didn't have the proper software to actually check that it's transparent - hence the confusion. I found this trick with Acrobat Reader settings. If you check this it will show a grid when transparent

Screenshot 2022-09-05 at 20 48 25

Then by commenting out line size.setBackgroundColor(new BaseColor(col.getRed(), col.getGreen(), col.getBlue())); on PDFExporter class you should get a transparent background.

@mbastian mbastian assigned mbastian and unassigned Meta-Ace Oct 8, 2022
mbastian added a commit that referenced this issue Oct 8, 2022
@mbastian
Copy link
Member

mbastian commented Oct 8, 2022

Added new checkbox in PDF config menu
Screenshot 2022-10-08 at 20 51 50

@mbastian mbastian closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDF Preview Wishlist New features (not a bug)
Projects
Status: Done
Development

No branches or pull requests

3 participants