Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:36:49+00:00 2026-06-01T23:36:49+00:00

I have a pdf doc which has 2 pages per page I want to

  • 0

I have a pdf doc which has 2 pages per page I want to split the page vertically and display the page in order (eg 100 page pfd doc will get converted to 200 pages doc)

I want to code it in may be php/javascript (is it possible). I want to upload any pdf doc to my website and then split it vertically then display the pages in order

Please let me how how to do this, I have tried to google but I could not find a solution

thanks

Edit:

I am trying to use clipRectangel() method:

<?php
require_once 'Zend/Pdf.php'; 
$pdf = Zend_Pdf::load('pages.pdf');
$page = $pdf->pages[0]; 
$page->clipRectangle(10, 10, 30, 30); 
$pdf->save('new.pdf'); 
?> 

I am trying to use clipRectangle to split vertically but I am not getting any modified pdf in ‘new.pdf’ I also want to order the pages,please suggest any better way to use zend. It would be helpful if you can give me few lines of code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:36:51+00:00Added an answer on June 1, 2026 at 11:36 pm

    This is a pretty tall order.

    Your best bet is to use Zend_Pdf which allows loading and altering of (unprotected) PDF files in php. Javascript cannot do this.

    This is of course not something that will work with just any PDF in any circumstance. You can get cut off text (half on one page, half on the other) as the entire process is not like HTML text.

    Converting a PDF to HTML is a whole other thing.

    Update: I’ve taken your code simply for illustration. Haven’t tested this, but if you get errors, you should be able to find the solution rather quickly.

    require_once 'Zend/Pdf.php'; 
    
    $pdf = Zend_Pdf::load('pages.pdf');
    $pdfnew = new Zend_Pdf();
    
    
    foreach ($pdf->pages as $page) {
        $curpage = $page;
    
        // Clipping for first part, enter your own numbers..
        $curpage->clipRectangle(10, 10, 30, 30);
        $pdfnew->pages[] = $curpage;
    
        $curpage = $page;
    
        // Clipping for second part, enter your own numbers..
        $curpage->clipRectangle(10, 10, 30, 30);
        $pdfnew->pages[] = $curpage;
    }
    
    $pdfnew->save('new.pdf'); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PDF which has an image on it (a logo) I want
I have a folder which contains doc, docx, xlsx, pdf and txt files. I
I have pdf document, for example 25 pages. How to add one blank page
I want to upload a file which may be a .doc or .pdf or
I have files like .doc .pdf .excel... and i want to open them externally.
I have a directory that contains jpg,tif,pdf,doc and xls. The client DB conly contains
I have an situation where i need to convert Doc file into PDF file.
in my application, I have pdf files. I want to save those pdf files
I have some PDF files in a public rails folder. I want to set
I have a script that lets the user upload text files (PDF or doc)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.