118 Commits

Author SHA1 Message Date
Jeff Young
a64278a12c Honour 0-width strokes on filled shapes. 2025-05-13 18:00:09 +01:00
Jeff Young
af4d14b66c 0 width means 0 width when plotting text.
There's no such thing as a default line width
for text.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20916
2025-05-13 17:48:58 +01:00
Marek Roszko
e30fdcb500 Write fileinput stream directly to zliboutput stream in Plot3DModel 2025-05-11 14:11:13 -04:00
Marek Roszko
0268ed6d28 Add 3d pdf functions to PDF_PLOTTER to reduce rebasing pain 2025-05-11 11:47:37 -04:00
jean-pierre charras
a02f1f2411 PDF plotter: fix a rare pen width issue when plotting many pages in one file.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20805
2025-05-01 19:57:29 +02:00
Jeff Young
3a4ad0fb8b Cleanup. 2025-05-01 17:02:31 +01:00
Jeff Young
1f07c28999 Fix a bunch of errors involving implied line widths in plotters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20818
2025-05-01 16:37:08 +01:00
Jeff Young
f4a5404e0a Resolve variables in hrefs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20340
2025-03-15 19:31:46 +00:00
Marek Roszko
ab6ee168cf Convert PDF_PLOTTER to fmtlib 2025-03-08 14:29:20 -05:00
Seth Hillbrand
4a3b33df4e Map a full hierarchy during PDF plotting
Re-create the schematic hierarchy in PDF plots to ease navigation
relative to the on screen schematic

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12154
2025-03-05 13:28:01 -08:00
Jeff Young
a9ddcf4287 Fix positions of popup menus when plotting in mirrored mode.
[Resolve conflicts with JP's fix to same.  I'm not sure if we support !m_mirrorIsHorizontal, but
it was in other code, so I left it in just to be
safe....]

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19717
2025-01-23 10:55:11 +00:00
jean-pierre charras
e9269e59f7 Pcbnew, PDF plot: fix property popup locations when plotting mirrored.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19717
2025-01-23 09:48:08 +01:00
Wayne Stambaugh
f161d94521 Common folder housekeeping part 2. 2025-01-14 15:25:05 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Wayne Stambaugh
930407fac8 Fix PDF plotter URI issues.
Add 'file:' URI JavaScript handlers.

Properly convert Windows file paths to valid URI syntax.

Use expanded variables for URI menu names.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250
2024-11-04 20:05:42 -05:00
Seth Hillbrand
88df35654e Prevent attempt at plotting invalid sheets
If the number does not exist in the schematic, don't attempt plotting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19039
2024-11-01 10:55:54 -07:00
Wayne Stambaugh
43c3cd57eb Substitute variables in PDF plotter URI links and add file:// URI handler.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14250
2024-10-24 08:06:28 -04:00
Dhinesh
8851cd77ab Fix missing text and graphics in PDFs generated by "Plot to PDF"
The "Plot to PDF" function was producing PDF files that lacked text and
graphic items in viewers like Adobe and Foxit. This issue was caused by
the use of the %g format specifier for floating-point numbers defined in
the PDF specification when writing text and drawing shapes in the PDF.
This incorrect format led to a "Too Few Operands" error during rendering.
To resolve this issue, all floating-point numbers must be specified in
fixed-point format according to the PDF specification wherever the issue
was generated.

Fixes #16465
2024-10-11 18:55:46 +00:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Jeff Young
e30b6398b7 ADDED: optional PDF metadata from AUTHOR and SUBJECT variables.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17289
2024-03-14 17:40:04 +00:00
Alex Shvartzkop
4d66a8ebdb Fix rendering/plotting of arcs with tiny angle and huge radius.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17343
2024-03-09 02:07:24 +03:00
Alex Shvartzkop
82a0227c20 Don't plot polygon borders when they are disabled. 2024-01-15 22:35:35 +03:00
Jeff Young
df83e24eb7 Cleanup.
It's been a long time since line style was specific to plotting.
2023-11-25 13:12:45 +00:00
Alex Shvartzkop
dc9df9517d PDF plot: match mirror state between hidden and plotted text.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16066

(cherry-picked from commit 31e79ef54ff9bf0d7cec7944db17ab7c8627c0e0)
2023-11-12 01:28:03 +03:00
Alex Shvartzkop
b0f4adf052 Improve borderless items logic in schematic plotting. 2023-10-12 08:40:37 +03:00
Alex Shvartzkop
843bd4f79c PDF plotting: fix zero-sized or too thick rectangles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15862
2023-10-12 06:11:11 +03:00
Alex Shvartzkop
10e2e4a12d Another try at fixing arcs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15471
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15469
2023-08-22 16:10:58 +03:00
Alex Shvartzkop
717ee350c8 Support >180 deg arcs in schematic. 2023-08-07 14:18:38 +03:00
Jeff Young
5e112ca78e ADDED: parameterize font metrics and allow customization of overbar height. 2023-08-06 20:57:41 +01:00
jean-pierre charras
34e9de72ae fix a compil warning (shadowed var) 2023-07-13 07:46:08 +02:00
Alex Shvartzkop
2689037bde PDF plotting: support bitmaps with transparency.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5979
2023-07-07 23:29:46 +05:00
jean-pierre charras
88ffcec4b5 Plotters (especially DXF) add more precision when plotting arcs (and others)
- in DXF coordinates were using 6 digits for coordinate mantissa: this is not
enough for coord in inches. Now use 16 digits
- Arc( VECTOR2I& aCentre, EDA_ANGLE& aStartAngle, EDA_ANGLE& aEndAngle, ...)
was using integers for coord. This creates significant errors for start point
and end points of the arc. Now the center is given in double, and its position
is calculated from angle end points (and radius) to do not generate a position error
for these end points (previously the error could be 20 ... 50 nm)
Fixes #15056
https://gitlab.com/kicad/code/kicad/-/issues/15056
2023-07-06 18:09:38 +02:00
Alex Shvartzkop
afe176abe2 Optimize PDF plot data size for property popups; fix unicode escape.
Adds a document-level action JSInit, which defines ShM function,
allowing more compact data representation. Also reduces whitespaces.
2023-07-04 08:57:29 +03:00
Alex Shvartzkop
698fffb128 PDF plotting: Fix "Show Page" in Foxit PDF Reader.
pageNum is an Integer. Acrobat seems to convert automatically.
2023-07-03 09:13:37 +03:00
Alex Shvartzkop
0d7b4bbb09 Blend transparent images with background color in PDF plotter. 2023-07-03 02:15:05 +03:00
Marek Roszko
ea077bc34d Banish ignore.h to core 2023-04-18 22:44:04 -04:00
Nimish Telang
51e55dd750 Convert sprintf to snprintf in most files 2023-04-17 15:39:34 +00:00
Seth Hillbrand
d405fff1d8 Correct alpha blending in PDF plot
We fake the alpha channel by pre-multiplying but we forgot to account
for the downscaling of the input channel value in addition to correcting
the alpha * white.  This led to clipping when the values overflowed

Fixes https://gitlab.com/kicad/code/kicad/issues/14238
2023-03-10 09:00:12 -08:00
jean-pierre charras
51d46c0e73 plotters rework: add plot fct to use TEXT_ATTRIBUTES class to pass text settings
Old PLOTTER::Text is not (yet) removed, but it use negative text size
to mirrored text, which is not really compatible with some plotters (especially PDF).
Using TEXT_ATTRIBUTES is much easy and much better,
so PLOTTER::PlotText() is added.
Note: "old" PLOTTER::Text() is not removed yet.
2023-02-26 14:44:53 +01:00
jean-pierre charras
f14e24d2cf PDF_plotter: fix crash when the font used to plot texts is not specified.
(In this case the default Kicad font must be used)
Fixes #13615
https://gitlab.com/kicad/code/kicad/issues/13615
2023-01-21 20:12:30 +01:00
Seth Hillbrand
da1707d5ba Place hidden PDF text behind words better
Rather than hiding a single line at once, we align each word in the
string with the approximate location of the output word.  This allows
better selecting text in the output pdf

Fixes https://gitlab.com/kicad/code/kicad/issues/12159
2023-01-19 15:53:46 -08:00
Jeff Young
be142af4d0 Another attempt at string encoding for JS inside a PDF.
Fixes https://gitlab.com/kicad/code/kicad/issues/12782
2022-11-06 14:34:54 +00:00
Jeff Young
1b93b8c51b Fix JS to support more Acrobat versions.
Fixes https://gitlab.com/kicad/code/kicad/issues/12819
2022-11-03 17:19:59 +00:00
Jeff Young
a2679f62cd Enormous hack to deal with JS encoding issues in PDF.
No, PDFDocEncoding (as spit out by encodeStringForPlotter()) does
not seem to work.

Fixes https://gitlab.com/kicad/code/kicad/issues/12782
2022-10-29 22:03:52 +01:00
Jeff Young
d37526ba42 Don't stroke outline font polygons, even with a really narrow pen.
Fixes https://gitlab.com/kicad/code/kicad/issues/12739
2022-10-25 11:58:25 +01:00
Wayne Stambaugh
598b09821a Coverity fixes. 2022-10-17 15:30:20 -04:00
Seth Hillbrand
863184e3dc Ensure node count is signed
Fixes a broken commit from a0865082fb6d26d9b9a6c178100be1068ce54360
2022-10-07 08:14:53 -07:00
Seth Hillbrand
a0865082fb Fix compile warnings 2022-10-04 17:06:45 -07:00
Marek Roszko
8f52821cd4 Add missing clear of children memory in outline node 2022-09-25 08:47:28 -04:00
jean-pierre charras
7c44dbd9d6 Fix gcc compil warnings. 2022-09-25 11:01:25 +02:00