PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Oct 10, 2024 8:53 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Jul 16, 2024 8:15 am 
Offline

Joined: Tue Jul 16, 2024 7:50 am
Posts: 1
I tried making an imposition program using PDFsharp, the program reads the media box and trim box on the source PDF file, the source PDF will be clipped mask (IntersectClip) and imposed.
The program runs well. The resulting PDF is exactly what I wanted, all the impositions appear, and have been opened by several PDF Viewers/Editors, even when the PDF file resulting from the imposition is opened in Adobe Illustrator or Corel Draw, the results remain the same as when opened in the PDF Viewer.

However, there is a problem with the results of IntersectClip, where the source PDF object (XPdfForm) that has been IntersectClip and imposed, does not appear in the RIP Fiery software preview and the printed results.

This is the code I use:

Code:
Dim ResFile As String = PDFlink.namaPDFlink
Dim form As XPdfForm = XPdfForm.FromFile(ResFile)

 Dim outputDocument As PdfSharp.Pdf.PdfDocument = New PdfSharp.Pdf.PdfDocument()
 outputDocument.Options.ColorMode = PdfColorMode.Cmyk
 outputDocument.Options.UseFlateDecoderForJpegImages = PdfUseFlateDecoderForJpegImages.Never
 outputDocument.Options.FlateEncodeMode = PdfFlateEncodeMode.Default
 outputDocument.Options.EnableCcittCompressionForBilevelImages = False
 outputDocument.Options.CompressContentStreams = False
 outputDocument.Options.NoCompression = False

'.......

gfx.Save()
Dim box As XRect
box = New XRect(PosX - ob.Bleed, PosY - ob.Bleed,
                        ob.trimboxWidth + (ob.Bleed * 2), ob.trimboxHeight + (ob.Bleed * 2))

Dim clipPath As XGraphicsPath = New XGraphicsPath()
clipPath.AddRectangle(box)
gfx.IntersectClip(clipPath)

gfx.DrawImage(form, PosX - ((ob.mediaboxWidth - ob.trimboxWidth) / 2), PosY - ((ob.mediaboxHeight - ob.trimboxHeight) / 2), ob.mediaboxWidth, ob.mediaboxHeight)
gfx.Restore()



Anyway thank you so much for helping out!
Best regards,
Ciung


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group