- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all! 😀
Since I've been around this forum I learned alot, and I want to give back something.
I'll show you how to insert a watermark in a PDF file, when exporting from a drawing.
Since Inventor doesn't have a native tool, this is clearly a workaround.
I'm assuming you already have an iLogic code to export a sheet to PDF.
For this you will need:
- Inventor;
- Image editor program (GIMP, PhotoShop, etc)
This is a screenshot from the exported PDF file.
Size, color, letter type, etc..., can be changed as you wish, because we will use a .PNG image with transparent background.
- Create an image on your image editor program, with the size of the sheet you use and transparent background. (A3 = 1684×1191 pixels);
- Create text, create images or insert them. This image will be layered on top of your drawing;
- Important: Set the opacity of your image/text to around 5%;
- Export to .png while maintaining the transparent background;
- On you Inventor make a copy of your border and edit the copy;
I have the "A2_Controlar_template_border", and made a copy and renamed it to "A2_Watermark".
6. Edit this copy and add the image you created, dimensionate it and bring it forward;
You can send backwards, that's up to personal taste.
7. Once you have both borders, we can proceed to the iLogic code, wich is pretty simple:
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oBorder As Border = oSheet.Border ' Check sheet size If ActiveSheet.Size = "A2" Then '['Insert A2 Watermark If ActiveSheet.Border = "A2_Border" Then oBorder.Delete ActiveSheet.Border = "A2_Watermark" End If '] '['Export PDF 'Insert the iLogic you use to export to PDF '] '['Remove A2 Watermark oBorder.Delete ActiveSheet.Border = "A2_Border" '] Exit Sub End If 'Check sheet size If ActiveSheet.Size = "A3" Then '['Insert A3 Watermark If ActiveSheet.Border = "A3_Border" Then oBorder.Delete ActiveSheet.Border = "A3_Watermark" End If '] '['Export PDF 'Insert the iLogic you use to export to PDF '] '['Remove A3 Watermark oBorder.Delete ActiveSheet.Border = "A3_Border" '] Exit Sub End If MessageBox.Show("Sheet size must be A2 or A3!")',"Sheet size error:",vbOKOnly) Exit Sub
Change "A2_Border" and "A3_Border" to the name of your border, the one without watermark.
Change "A2_Watermark" and "A3_Watermark" to the name of your border with watermark.
And that's it!
You can use the drawing sheet without any image or text in front.
But every time you run the rule to export, it will insert the new border, export and then restore the normal one.
Notes:
- This is a workaround that really works for me, but others might export using different methods.
- My way of exporting to PDF is very specific, hence why my code isn't there.
Hope it helps! 😊
João Silva
Mechanical Engineer
Solved! Go to Solution.