Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 09, 2014 6:03 pm

How can I set the OverPrint PDF property of a color. Does Spire.PDF support this?

Thanks!
Chris

kleinux
 
Posts: 4
Joined: Tue Sep 09, 2014 6:00 pm

Wed Sep 10, 2014 9:36 am

Dear Kleinux,

Thanks for your inquiry.

Yes, Spire.PDF supports this feature by setting transparency property.
Please send us a sample file so that we can provide you some code snippets.

Best regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Sep 10, 2014 5:52 pm

I tried sending an example PDF of what I am trying to generate but the forum software told me PDF file types are not allowed.

I work for a screen printer, so my goal here is to produce a PDF from data in my order entry system that will work with my screen rip software. I am trying to mimic choosing 'Overprint Fill' on a color in Illustrator before exporting a PDF. What inputs into the SetTransparency function will do that for me?

kleinux
 
Posts: 4
Joined: Tue Sep 09, 2014 6:00 pm

Thu Sep 11, 2014 2:22 am

Dear Kleinux,

Thanks for your reply.
Please send the example pdf to burning.liu@e-iceblue.com.

Best regards,
Burning
E-iceblue Support Team
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Mon Dec 13, 2021 4:06 pm

Was this ever resolved? I would also like to set overprint for a path I am drawing onto a page canvas.

emaginationstore
 
Posts: 15
Joined: Mon Sep 25, 2017 2:02 pm

Tue Dec 14, 2021 8:40 am

Hello,

Thank you for your inquiry.
Please refer to the following code to achieve your requirement (set overprint for a path). If my understanding is wrong, please provide more detailed information for our reference. Thanks in advance.
Code: Select all
  static void Main(string[] args)
  {
      PdfDocument doc = new PdfDocument();
      doc.LoadFromFile("input.pdf");
      PdfPageBase page = doc.Pages[0];
      DrawPath(page);
      doc.SaveToFile("output.pdf");
      doc.Close();
  }
  private static void DrawPath(PdfPageBase page)
  {
      PointF[] points = new PointF[5];
      for (int i = 0; i < points.Length; i++)
      {
          float x = (float)Math.Cos(i * 2 * Math.PI / 5);
          float y = (float)Math.Sin(i * 2 * Math.PI / 5);
          points[i] = new PointF(x, y);
      }
      PdfPath path = new PdfPath();
      path.AddLine(points[2], points[0]);
      path.AddLine(points[0], points[3]);
      path.AddLine(points[3], points[1]);
      path.AddLine(points[1], points[4]);
      path.AddLine(points[4], points[2]);

      //Save graphics state
      PdfGraphicsState state = page.Canvas.Save();
      PdfPen pen = new PdfPen(Color.DeepSkyBlue, 0.02f);
      PdfBrush brush1 = new PdfSolidBrush(Color.CadetBlue);

      page.Canvas.SetTransparency(0.6f);

      page.Canvas.ScaleTransform(50f, 50f);
      page.Canvas.TranslateTransform(5f, 1.2f);
      page.Canvas.DrawPath(pen, path);

      page.Canvas.TranslateTransform(2f, 0f);
      path.FillMode = PdfFillMode.Alternate;
      page.Canvas.DrawPath(pen, brush1, path);

      page.Canvas.TranslateTransform(2f, 0f);
      path.FillMode = PdfFillMode.Winding;
      page.Canvas.DrawPath(pen, brush1, path);

      PdfLinearGradientBrush brush2 = new PdfLinearGradientBrush(new PointF(-2, 0), new PointF(2, 0), Color.Red, Color.Blue);
      page.Canvas.TranslateTransform(-4f, 2f);
      path.FillMode = PdfFillMode.Alternate;
      page.Canvas.DrawPath(pen, brush2, path);

      PdfRadialGradientBrush brush3 = new PdfRadialGradientBrush(new PointF(0f, 0f), 0f, new PointF(0f, 0f), 1f, Color.Red, Color.Blue);
      page.Canvas.TranslateTransform(2f, 0f);
      path.FillMode = PdfFillMode.Winding;
      page.Canvas.DrawPath(pen, brush3, path);

      PdfTilingBrush brush4 = new PdfTilingBrush(new RectangleF(0, 0, 4f, 4f));
      brush4.Graphics.DrawRectangle(brush2, 0, 0, 4f, 4f);

      page.Canvas.TranslateTransform(2f, 0f);
      path.FillMode = PdfFillMode.Winding;
      page.Canvas.DrawPath(pen, brush4, path);

      //Restore graphics
      page.Canvas.Restore(state);
  }

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Tue Dec 14, 2021 10:00 am

Hi,

This only simulates the effects of overprint and doesn't actually set the overprint option in the PDF.

Thanks

emaginationstore
 
Posts: 15
Joined: Mon Sep 25, 2017 2:02 pm

Wed Dec 15, 2021 9:25 am

Hi,

Thank you for your feedback.
Does the "set the overprint option" you mentioned refer to the OverPrint option in Adobe (as shown in the screenshot)? If yes, sorry that our Spire.PDF does not support it yet. If not, please provide a detailed description about the function. I would appreciate if you attach a screenshot in Adobe or online help documents.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Wed Dec 15, 2021 10:39 am

Hi,

Overprint is a graphics state parameter used when drawing objects in a PDF and information on it can be found in section 8.6.7 of the PDF specification (PDF 1.7).

I have uploaded 2 PDFs, one with overprint set on the foremost layer and one without.

If you open the file without overprint in Acrobat, open the overprint tool, and uncheck the process plates, you will see that the star on the spot plate has been partially 'knocked out' because of the star on the process plates.

no-overprint.png


Then if you open the file with overprint and do the same, you will see that the star on the spot plate remains whole.

overprint.png


Please could you add this to your future features list?

Thanks

emaginationstore
 
Posts: 15
Joined: Mon Sep 25, 2017 2:02 pm

Thu Dec 16, 2021 2:06 am

Hello,

Thank you for your sharing.
I have added this feature to our future features list with the ticket number SPIREPDF-4843. Our Dev team will investigate and determine whether it can be achieved. Once there are any updates related to this feature, I will notify you in immediately.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF