Can be Printer friendly Block code?

Is it possible to print Block code without color inside the blocks, only the line of the block (to see the structure)?

This will be a economic way to print the code without wasting color ink.

1 Like

I have seen printer vendor supplied drivers that let you set the printer to work in grey scale.

Check the settings in your Operating System's Print dialog.

I think he don't want to print the gray color even, only the outline needed.
This may be achieved by change the SVG of block using javascript.

what about this:

just copy this to console panel, and hit enter.....

(function outline(){
	var paths = document.getElementsByTagName("path");
	for(var i = 0; i<paths.length;i++){
		paths[i].style = "fill:transparent; stroke:black;";
	}
	
	var rects = document.getElementsByTagName("rect");
	for(var i = 0; i<rects.length;i++){
		rects[i].style = "fill:transparent; stroke:black;";
	}

	var texts = document.getElementsByTagName("text");
	for(var i = 0; i<texts.length;i++){
		texts[i].style = "fill:black";
	}
	
	var tspans = document.getElementsByTagName("tspan");
	for(var i = 0; i<tspans.length;i++){
		tspans[i].style = "fill:black";
	}
	
	var circles = document.getElementsByTagName("circle");
	for(var i = 0; i<circles.length;i++){
		circles[i].style = "fill:transparent;stroke:black;";
	}
	
	var textareas = document.getElementsByTagName("textarea");
	for(var i = 0; i<textareas.length;i++){
		textareas[i].style = "background-color:transparent;";
	}

})()
6 Likes

Good job

2 Likes

one issue: all colors will be white

No, colors are transparent. :grin:

1 Like

ok, it looks like white.

what i means is we can not tell what the origin color is after this "outline" act.

-----edit--------
Oh, the download png also be transparent. :grinning_face_with_smiling_eyes: I did not test that before.

1 Like

What if you could make the outline in the color of the category? This way you would save ink but still see where the block is coming from.

technically it should be doable.
but normaly user will know where the block come from if they already use AI for a while.

And this js only work for the exist blocks, not for newly added ones.
More work needed to change the style permernently.

for example, we can changed to dark mode:

2 Likes

I thing that transparent will be the perfect, so when you put it in document uses the background white.

Is it possible to reduce the thicknees of the lines?

you can add "stroke-width:1;" to path's and rect's style.
or change 1 to 0.5, 0.2 to see which one you like.

@ABG
I suggest adding this solution to the AP INVENTOR resources file or somewhere in the AI documentation for reference.

MIT will add that. But it's not right for them to add, since this is an unofficial modification. @ABG is an MIT Fan, not an MIT student.

(added to Blocks Printing section of FAQ)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.