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

[Feature Request] Adding PDF as output #354

Open
tobiasfalk opened this issue May 20, 2024 · 9 comments
Open

[Feature Request] Adding PDF as output #354

tobiasfalk opened this issue May 20, 2024 · 9 comments

Comments

@tobiasfalk
Copy link

We may already have SVG as a vector graphics output, but it still would be nice if PDF would also be available.

@martinrieder
Copy link

martinrieder commented May 20, 2024

This has been in development for some time. Check #32 and the associated feature branch.
The new CLI offers a switch to request PDF output format, but it is not implemented yet.

I noticed your repo https://github.com/tobiasfalk/KiCAD-FreeCAD-TechDraw-Template-Generator.
It seems that you have some experience in that area. Feel free to contribute to #304 as well. ^^

@tobiasfalk
Copy link
Author

tobiasfalk commented May 20, 2024

@martinrieder
I took a look at #32 and #304, and I am a bit confused, is it now possible to draw the wiring plan in to a drawing frame with title block or not, if yes how, since there is no mention I found in the doc or examples.
If the whole drawing frame with title block inclusion is not stated or though out I would recommend using an already existing template format, like the FreeCAD SVG, this would bring the benefit that there are already some templates existing and that in its base form it is just an SVG that can be rendered normally.
In that the fields that are meant to be edited have the XML attribute freecad:editable with a variable name and some like the title or the author/creator have the additional attribute freecad:autofill with a specified value in it to identified what it is (FreeCAD #13005 and #13790).
With these ids the text that is in them can be changed before handing the template/svg over to the drawing engine to use.

When it comes to coding I would polity decline, since I not only do not really have too much experience with Python and especially not with graphvis (even when the issues I opened in the last view day would sugset otherwise I never used graphviz before that).
What I am happily do is help with question where I can and with ideas on improving things.

@kvid
Copy link
Collaborator

kvid commented May 20, 2024

Take a look at demo02

@martinrieder
Copy link

@kvid I was thinking of something like #227. The table that is contained in the HTML output of Demo02 could well be implemented in a GV node.

@tobiasfalk there are many ways that the frame and title blocks could be drawn. What do you suggest? Only add it for "printable" formats like PDF?

I do not consider HTML to be truly printable, though it should be possible to convert it into PDF.

@tobiasfalk
Copy link
Author

@tobiasfalk there are many ways that the frame and title blocks could be drawn. What do you suggest? Only add it for "printable" formats like PDF?

I would add it to all Formats, since the user may want to use it in Programs like word where imprting a PDF as a page is not possible(theoretically yes but I have tried for weeks and was not able to do it).
So giving the user the ability to export this as a PNG with tilteblock is defenetly a good idea, has also the benefit of being able to use it in issues and not rely on the reader to open a link to a file or so.

I do not have the ability to do something for a while(not at home), but could one of you try to import one SVG from the FreeCAD templates as image in the background?

@tobiasfalk
Copy link
Author

Take a look at demo02

If I see this correctly, you are drawing this frame amd titleblock internally, wich is cald by the template tag.
This limits the user to only the templates that are integrated in to WireViz, so to get a new formate that the user wants he needs to program it in to wireviz.

I would recommend a external template file formate, like svg and maybe even freecad svgs since there a lot of work is already done and for users that use both it reduces work

@kvid
Copy link
Collaborator

kvid commented May 21, 2024

@tobiasfalk wrote:

Take a look at demo02

If I see this correctly, you are drawing this frame amd titleblock internally, wich is cald by the template tag. This limits the user to only the templates that are integrated in to WireViz, so to get a new formate that the user wants he needs to program it in to wireviz.

No, the HTML template might also be located at the same folder as any YAML source. In addition, the template might be specified with a relative or absolute path.

I would recommend a external template file formate, like svg and maybe even freecad svgs since there a lot of work is already done and for users that use both it reduces work

I agree, there are different existing template solutions available (including other HTML based templates), but currently, an internal HTML template format is implemented. Other suggestions are welcome, and I encourage you to describe some criteria we should aim for to enable comparing different alternatives.

@martinrieder
Copy link

martinrieder commented Jun 5, 2024

I do not have the ability to do something for a while(not at home), but could one of you try to import one SVG from the FreeCAD templates as image in the background?

Merging two SVG files seems like a simple task. Converting this into PDF can be solved with other tools.

I would reverse the process and feed HTML into Graphviz. If you put this into a graph that only contains a single node, you can use it as a tool for SVG conversion.

By putting the BOM table into a dedicated node on the WireViz output, it could also assure that this does not overlap with the graph. Positioning and scaling might be an issue though.

Do you know if it is possible to predefine a container or an anchor in some SVG template files that could be used for merging?

@tobiasfalk
Copy link
Author

https://forum.graphviz.org/t/background-image-frame-for-the-graph/2232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants