Menu

Page Rotation

Help
2018-04-02
2018-04-03
  • J.A. Alderliesten

    I try to Add a Landscape PDF document to the original Portrait one.
    The rotation works fine but after the page clips are 210x210. So the format is not going well.
    I.e. looks like that only the content is rotated like I did confirm the sample.

        Dim FileName As org.pdfclown.files.File = New org.pdfclown.files.File(TempFilePath & "Faktuur.pdf")
        Dim Document As Document = FileName.Document
    
        Dim oPDF As PageManager = New PageManager(Document)
    
        FileName = New org.pdfclown.files.File(TempFilePath & "FaktuurBijlage.pdf")
        Document = FileName.Document
    
        For Each Pagina As Page In Document.Pages
            Pagina.Rotation = contents.RotationEnum.Rightward
        Next
    
        oPDF.Add(Document)
    
        oPDF.Document.File.Save()
        oPDF.Document.File.Dispose()
        FileName.Dispose()
    

    Has anyone a idea how to ratate the pages correctly?

    Thanks in advance,
    Jan

     

    Last edit: J.A. Alderliesten 2018-04-02
  • J.A. Alderliesten

    Even the change after reading this article didnt work well:
    https://sourceforge.net/p/clown/discussion/607162/thread/3dad06f0/#d921

    Dim destFileName As files.File = New files.File(TempFilePath & "Faktuur.pdf")
        Dim sourceFileName As files.File = New files.File(TempFilePath & "FaktuurBijlage.pdf")
        Dim destDocument As Document = destFileName.Document
        Dim sourceDocument As Document = sourceFileName.Document
        Dim destPages As Pages = destDocument.Pages
        Dim sourcePages As Pages = sourceDocument.Pages
    
        For Each Pagina As Page In sourceDocument.Pages
            destPages.Add(Pagina.Clone(destDocument))
        Next
    
        destFileName.Save()
        destFileName.Dispose()
        sourceFileName.Dispose()
    

    I hope someone have an idea about this problem. Im doing something wrong I guess but cannot find the proper documentation to correct.

     
  • J.A. Alderliesten

    When I have two original portrait PDF files and merge them then everything works fine.
    But when one document is rotated by this way:

    For Each Pagina As Page In Document.Pages
        Pagina.Rotation = contents.RotationEnum.Rightward
    Next
    

    and saved after then in Adobe it looks correct but merged to the source document the page dimensions are 210x210.

    So it looks like that with the rotation something is not quite well or I missed a part but I hope someone have a good idea... or Im the first to try to rotate and merge ?

     

Log in to post a comment.