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 8859215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:00:07+00:00 2026-06-14T15:00:07+00:00

I am currently working on a web2print project based on Adobes Scene7. The full

  • 0

I am currently working on a web2print project based on Adobes Scene7. The full url to a print product (pdf) is very long and exceeds all browser limitation of url length. So to get the final print product I assume I have to submit the url in a different way via POST method.
There seem to be two ways: First, use a html form (method=post) and create all url parameters as (hidden) input fields. Second, make an ajax call (e.g. jQuery.ajax) with post.

Actually if I would open the print url in the browser, the ready pdf would be opened within the browser. So I need a way to send the very long url via POST to the server and open the PDF I get back from it. Testing the ajax version I ran into the same-origin-policy and get an error, as I call a url not on my local server. This must be a standard situation in web2print projects, how is this handled?

Thx in advance
Michbeck

  • 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-14T15:00:08+00:00Added an answer on June 14, 2026 at 3:00 pm

    I got the problem solved. I did it in two steps. First I use ajax to send the base url and the url parameters to a php script on my local server. It is easily done with jQuery:

    jQuery.ajax({
        type : "POST",
        url : './includes/php/userdata.php',
        data: { method: 'get_print_version',
                url: base_url,                  
                parameter: query_parameter,
                num: num_parameter },
        error: function(error) {
            console.log("Print version failed");
      },
      success: function(reault) {
        console.log("What is the result?");
      }         
    });             
    

    The server script uses cURL to send the data to the final server. Therefore the base url and the parameters are not posted as one url but seperated by the use of CURLOPT_POST and CURLOPT_POSTFIELDS. The server response (a pdf) can be written to file with file_put_contents. If the PDF gets to big, you will get a memory limitation error here. Than it is better to write the answer from cURL directly to the pdf file.

    if ($_method == 'get_print_version')
    {
        $url = $_REQUEST['url'];
        $parameter = $_REQUEST['parameter'];
        $num = $_REQUEST['num'];
    
        $post = curl_init();
    
        curl_setopt($post, CURLOPT_URL, $url);
        curl_setopt($post, CURLOPT_POST, $num);
        curl_setopt($post, CURLOPT_POSTFIELDS, $parameter);
    
        /* write calendar directly to file */
        $pdf = fopen('./Calendar.pdf', 'w');
        curl_setopt($post, CURLOPT_FILE, $pdf);
    
        curl_exec($post);
        curl_close($post);          
    
        echo $result;           
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently working on a flex AIR project based on PureMVC framework. There was a
Currently working in the deployment of an OFBiz based ERP, we've come to the
Currently working on database part of android project. The main aim of the project
I currently working on a project which uses Spree Cart and which has hence
im currently working on a project that involves listing contacts with a photo and
Im currently working on a project that requires the following. I need to be
I'm currently working on a consumer mobile application project and have read that 40%
Currently working on a project with the cloud / azure and windows phone 7,
Im currently working on a c# project that uses another .net library. This library
Im currently working on a custom product list in the Magento backend. Heres the

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.