PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Resizing from a D-Size PDF to a B-Sze PDF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1356
Page 1 of 1

Author:  moosemanca [ Thu Sep 30, 2010 2:00 pm ]
Post subject:  Resizing from a D-Size PDF to a B-Sze PDF

Greetings,

I am working on an APP to batch print CADD drawings from PDFs. While the printing part is not an issue, the part of allowing the user to select the size they would like to "Scale" it to is an issue.

Is there a way to open a PDF, resize from the original, to the new user selected size? I am aware of how to set a page size, however the content remains the same size and simply crops. If I scale up, the drawing appears in the bottom as a small square, and if I scale down, it only shows a limited portion of the original.

Thank-you!

Author:  Thomas Hoevel [ Thu Sep 30, 2010 3:38 pm ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

With PDFsharp you can do it like the TwoPagesOnOne sample shows.

Author:  moosemanca [ Thu Sep 30, 2010 4:24 pm ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

GREAT!

This seems to be working ok, but whenever I run my code (I get the same error from some of the examples)

I get the error:
// If this occurs it is an internal error
Debug.Assert(false, "Object type transformation must not be done with direct objects");

Author:  Thomas Hoevel [ Mon Oct 04, 2010 7:22 am ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

It's not an error, it's an assertion. Message won't show in Release builds.
AFAIK you can remove this line without problems.

Author:  moosemanca [ Tue Oct 12, 2010 7:14 pm ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

Thomas Hoevel wrote:
It's not an error, it's an assertion. Message won't show in Release builds.
AFAIK you can remove this line without problems.


When I publish my Application, or change the configuration to Release, it is still asserted!

I guess I can remove the code, but I am kind of wondering why it does this, perhaps to prevent it, rather than silent it.

Author:  Thomas Hoevel [ Wed Oct 13, 2010 8:10 am ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

moosemanca wrote:
When I publish my Application, or change the configuration to Release, it is still asserted!

Debug.Assert does nothing in the Release build (unless you changed the Release build configuration). Don't forget to build and publish.

The author of this Debug.Assert is not sure if it can be safely removed.
In the cases when I got this messages I just ignored it and the documents all looked fine.

I'm sorry for the irritation it causes.

Author:  moosemanca [ Wed Oct 13, 2010 2:45 pm ]
Post subject:  Re: Resizing from a D-Size PDF to a B-Sze PDF

Thomas Hoevel wrote:
moosemanca wrote:
When I publish my Application, or change the configuration to Release, it is still asserted!

Debug.Assert does nothing in the Release build (unless you changed the Release build configuration). Don't forget to build and publish.

The author of this Debug.Assert is not sure if it can be safely removed.
In the cases when I got this messages I just ignored it and the documents all looked fine.

I'm sorry for the irritation it causes.


I hate myself. I meant publish/Release build of MY project.... awwwkward....


Thanks Wo/Man!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/